Merge "placeholder-message for html form should be ->text() not ->parse()"
[lhc/web/wiklou.git] / includes / api / ApiQueryBacklinksprop.php
index 00cbcd9..ef02d09 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Created on Aug 19, 2014
  *
- * Copyright © 2014 Brad Jorsch <bjorsch@wikimedia.org>
+ * Copyright © 2014 Wikimedia Foundation and contributors
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -161,7 +161,9 @@ class ApiQueryBacklinksprop extends ApiQueryGeneratorBase {
                                }
                        } else {
                                $this->addWhereFld( "{$p}_from_namespace", $params['namespace'] );
-                               if ( !empty( $settings['from_namespace'] ) && count( $params['namespace'] ) > 1 ) {
+                               if ( !empty( $settings['from_namespace'] )
+                                       && $params['namespace'] !== null && count( $params['namespace'] ) > 1
+                               ) {
                                        $sortby["{$p}_from_namespace"] = 'int';
                                }
                        }