mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-24 08:14:09 +00:00
Use strict equality when comparing namespaces
Change-Id: I15288a83d1ddb3744653077daddd7ebb7e8bba73
This commit is contained in:
parent
5610142a87
commit
16f2db8987
|
@ -265,7 +265,7 @@ class ScribuntoHooks {
|
|||
// Let TemplateStyles override Scribunto
|
||||
return true;
|
||||
}
|
||||
if ( $title->getNamespace() == NS_MODULE && !Scribunto::isDocPage( $title ) ) {
|
||||
if ( $title->getNamespace() === NS_MODULE && !Scribunto::isDocPage( $title ) ) {
|
||||
$model = CONTENT_MODEL_SCRIBUNTO;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -269,7 +269,7 @@ class Scribunto_LuaLanguageLibrary extends Scribunto_LuaLibraryBase {
|
|||
|
||||
// Check for "User:" prefix
|
||||
$title = Title::newFromText( $username );
|
||||
if ( $title && $title->getNamespace() == NS_USER ) {
|
||||
if ( $title && $title->getNamespace() === NS_USER ) {
|
||||
$username = $title->getText();
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class Scribunto_LuaUriLibrary extends Scribunto_LuaLibraryBase {
|
|||
}
|
||||
if ( $title ) {
|
||||
# Convert NS_MEDIA -> NS_FILE
|
||||
if ( $title->getNamespace() == NS_MEDIA ) {
|
||||
if ( $title->getNamespace() === NS_MEDIA ) {
|
||||
$title = Title::makeTitle( NS_FILE, $title->getDBkey() );
|
||||
}
|
||||
if ( $query !== null ) {
|
||||
|
|
Loading…
Reference in a new issue