Merge "Add tests for class names in the api main and query module manager"
[lhc/web/wiklou.git] / includes / db / DatabaseMssql.php
index af3cc72..669525a 100644 (file)
@@ -692,7 +692,7 @@ class DatabaseMssql extends DatabaseBase {
                        if ( !is_null( $identity ) ) {
                                // then we want to get the identity column value we were assigned and save it off
                                $row = $ret->fetchObject();
-                               if( is_object( $row ) ){
+                               if ( is_object( $row ) ) {
                                        $this->mInsertId = $row->$identity;
                                }
                        }
@@ -953,12 +953,8 @@ class DatabaseMssql extends DatabaseBase {
                // Matches: LIMIT {[offset,] row_count | row_count OFFSET offset}
                $pattern = '/\bLIMIT\s+((([0-9]+)\s*,\s*)?([0-9]+)(\s+OFFSET\s+([0-9]+))?)/i';
                if ( preg_match( $pattern, $sql, $matches ) ) {
-                       // row_count = $matches[4]
                        $row_count = $matches[4];
-                       // offset = $matches[3] OR $matches[6]
-                       $offset = $matches[3] or
-                       $offset = $matches[6] or
-                       $offset = false;
+                       $offset = $matches[3] ?: $matches[6] ?: false;
 
                        // strip the matching LIMIT clause out
                        $sql = str_replace( $matches[0], '', $sql );