summaryrefslogtreecommitdiff
path: root/includes/StubObject.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/StubObject.php')
-rw-r--r--includes/StubObject.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/includes/StubObject.php b/includes/StubObject.php
index 1501d963..894550cd 100644
--- a/includes/StubObject.php
+++ b/includes/StubObject.php
@@ -24,7 +24,7 @@ class StubObject {
}
static function isRealObject( $obj ) {
- return is_object( $obj ) && !is_a( $obj, 'StubObject' );
+ return is_object( $obj ) && !($obj instanceof StubObject);
}
function _call( $name, $args ) {
@@ -35,7 +35,7 @@ class StubObject {
function _newObject() {
return wfCreateObject( $this->mClass, $this->mParams );
}
-
+
function __call( $name, $args ) {
return $this->_call( $name, $args );
}
@@ -100,7 +100,8 @@ class StubUserLang extends StubObject {
}
# Validate $code
- if( empty( $code ) || !preg_match( '/^[a-z]+(-[a-z]+)?$/', $code ) ) {
+ if( empty( $code ) || !preg_match( '/^[a-z-]+$/', $code ) ) {
+ wfDebug( "Invalid user language code\n" );
$code = $wgContLanguageCode;
}