dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add TitleMove hook
[lhc/web/wiklou.git]
/
includes
/
Title.php
diff --git
a/includes/Title.php
b/includes/Title.php
index
0c223af
..
3e6f11b
100644
(file)
--- a/
includes/Title.php
+++ b/
includes/Title.php
@@
-1441,7
+1441,7
@@
class Title {
$url = str_replace( '$1', $dbkey, $wgArticlePath );
wfRunHooks( 'GetLocalURL::Article', array( &$this, &$url ) );
} else {
$url = str_replace( '$1', $dbkey, $wgArticlePath );
wfRunHooks( 'GetLocalURL::Article', array( &$this, &$url ) );
} else {
- global $wgVariantArticlePath, $wgActionPaths;
+ global $wgVariantArticlePath, $wgActionPaths
, $wgContLang
;
$url = false;
$matches = array();
$url = false;
$matches = array();
@@
-1463,6
+1463,7
@@
class Title {
if ( $url === false &&
$wgVariantArticlePath &&
if ( $url === false &&
$wgVariantArticlePath &&
+ $wgContLang->getCode() === $this->getPageLanguage()->getCode() &&
$this->getPageLanguage()->hasVariants() &&
preg_match( '/^variant=([^&]*)$/', $query, $matches ) )
{
$this->getPageLanguage()->hasVariants() &&
preg_match( '/^variant=([^&]*)$/', $query, $matches ) )
{
@@
-3619,6
+3620,8
@@
class Title {
$createRedirect = true;
}
$createRedirect = true;
}
+ wfRunHooks( 'TitleMove', array( $this, $nt, $wgUser ) );
+
// If it is a file, move it first.
// It is done before all other moving stuff is done because it's hard to revert.
$dbw = wfGetDB( DB_MASTER );
// If it is a file, move it first.
// It is done before all other moving stuff is done because it's hard to revert.
$dbw = wfGetDB( DB_MASTER );
@@
-4751,9
+4754,10
@@
class Title {
* they will already be wrapped in paragraphs.
*
* @since 1.21
* they will already be wrapped in paragraphs.
*
* @since 1.21
+ * @param int oldid Revision ID that's being edited
* @return Array
*/
* @return Array
*/
- public function getEditNotices() {
+ public function getEditNotices(
$oldid = 0
) {
$notices = array();
# Optional notices on a per-namespace and per-page basis
$notices = array();
# Optional notices on a per-namespace and per-page basis
@@
-4780,6
+4784,8
@@
class Title {
$notices[$editnoticeText] = $editnoticeMsg->parseAsBlock();
}
}
$notices[$editnoticeText] = $editnoticeMsg->parseAsBlock();
}
}
+
+ wfRunHooks( 'TitleGetEditNotices', array( $this, $oldid, &$notices ) );
return $notices;
}
}
return $notices;
}
}