Blame hashar for this giant commit; he teased me for making so many smaller ones...
[lhc/web/wiklou.git] / includes / api / ApiProtect.php
index 615db56..34c56d7 100644 (file)
@@ -63,6 +63,7 @@ class ApiProtect extends ApiBase {
                }
 
                $restrictionTypes = $titleObj->getRestrictionTypes();
+               $dbr = wfGetDB( DB_SLAVE );
 
                $protections = array();
                $expiryarray = array();
@@ -86,7 +87,7 @@ class ApiProtect extends ApiBase {
                        }
 
                        if ( in_array( $expiry[$i], array( 'infinite', 'indefinite', 'never' ) ) ) {
-                               $expiryarray[$p[0]] = Block::infinity();
+                               $expiryarray[$p[0]] = $dbr->getInfinity();
                        } else {
                                $exp = strtotime( $expiry[$i] );
                                if ( $exp < 0 || !$exp ) {
@@ -100,7 +101,7 @@ class ApiProtect extends ApiBase {
                                $expiryarray[$p[0]] = $exp;
                        }
                        $resultProtections[] = array( $p[0] => $protections[$p[0]],
-                                       'expiry' => ( $expiryarray[$p[0]] == Block::infinity() ?
+                                       'expiry' => ( $expiryarray[$p[0]] == $dbr->getInfinity() ?
                                                                'infinite' :
                                                                wfTimestamp( TS_ISO_8601, $expiryarray[$p[0]] ) ) );
                }