Use strict equality when comparing namespaces

Change-Id: I15288a83d1ddb3744653077daddd7ebb7e8bba73
This commit is contained in:
Ed Sanders 2021-01-01 16:44:40 +00:00
parent 5610142a87
commit 16f2db8987
3 changed files with 3 additions and 3 deletions

View file

@ -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;
}

View file

@ -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();
}

View file

@ -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 ) {