=== Configuration changes in 1.20 ===
=== New features in 1.20 ===
-* Added TitleIsKnown hook which gets called when determining if a page exists.
+* Added TitleIsAlwaysKnown hook which gets called when determining if a page exists.
* (bug 32341) Add upload by URL domain limitation.
=== Bug fixes in 1.20 ===
$title: Title object that is being checked
$result: Boolean; whether MediaWiki currently thinks this is a CSS/JS page. Hooks may change this value to override the return value of Title::isCssOrJsPage()
-'TitleIsKnown': Called when determining if a page exists.
+'TitleIsAlwaysKnown': Called when determining if a page exists.
Allows overriding default behaviour for determining if a page exists.
If $isKnown is kept as null, regular checks happen. If it's a boolean, this value is returned by the isKnown method.
$title: Title object that is being checked
* @return Bool
*/
public function isAlwaysKnown() {
+ $isKnown = null;
+
+ /**
+ * Allows overriding default behaviour for determining if a page exists.
+ * If $isKnown is kept as null, regular checks happen. If it's
+ * a boolean, this value is returned by the isKnown method.
+ *
+ * @since 1.20
+ *
+ * @param Title $title
+ * @param boolean|null $isKnown
+ */
+ wfRunHooks( 'TitleIsAlwaysKnown', array( $this, &$isKnown ) );
+
+ if ( !is_null( $isKnown ) ) {
+ return $isKnown;
+ }
+
if ( $this->mInterwiki != '' ) {
return true; // any interwiki link might be viewable, for all we know
}
+
switch( $this->mNamespace ) {
case NS_MEDIA:
case NS_FILE:
* @return Bool
*/
public function isKnown() {
- $isKnown = null;
-
- /**
- * Allows overriding default behaviour for determining if a page exists.
- * If $isKnown is kept as null, regular checks happen. If it's
- * a boolean, this value is returned by the isKnown method.
- *
- * @since 1.20
- *
- * @param Title $title
- * @param boolean|null $isKnown
- */
- wfRunHooks( 'TitleIsKnown', array( $this, &$isKnown ) );
-
- return is_null( $isKnown ) ? ( $this->isAlwaysKnown() || $this->exists() ) : $isKnown;
+ return $this->isAlwaysKnown() || $this->exists();
}
/**