Follow up r65286. If we are going to support <img we should support width and height
[lhc/web/wiklou.git] / includes / db / DatabaseMssql.php
index c5ff676..73861db 100644 (file)
@@ -45,6 +45,10 @@ class DatabaseMssql extends DatabaseBase {
 
        }
 
+       function getType() {
+               return 'mssql';
+       }
+
        /**
         * todo: check if these should be true like parent class
         */
@@ -131,7 +135,7 @@ class DatabaseMssql extends DatabaseBase {
        function close() {
                $this->mOpened = false;
                if ($this->mConn) {
-                       if ($this->trxLevel()) $this->immediateCommit();
+                       if ($this->trxLevel()) $this->commit();
                        return mssql_close($this->mConn);
                } else return true;
        }
@@ -829,7 +833,7 @@ class DatabaseMssql extends DatabaseBase {
                if ($offset) {
                        throw new DBUnexpectedError( $this, 'Database::limitResult called with non-zero offset which is not supported yet' );
                } else {
-                       $sql = ereg_replace("^SELECT", "SELECT TOP $limit", $sql);
+                       $sql = preg_replace("/^SELECT/i", "SELECT TOP $limit", $sql);
                }
                return $sql;
        }
@@ -842,22 +846,6 @@ class DatabaseMssql extends DatabaseBase {
                return $this->lastErrno() == 1205;
        }
 
-       /**
-        * Begin a transaction, committing any previously open transaction
-        * @deprecated use begin()
-        */
-       function immediateBegin( $fname = 'Database::immediateBegin' ) {
-               $this->begin();
-       }
-
-       /**
-        * Commit transaction, if one is open
-        * @deprecated use commit()
-        */
-       function immediateCommit( $fname = 'Database::immediateCommit' ) {
-               $this->commit();
-       }
-
        /**
         * Return MW-style timestamp used for MySQL schema
         */
@@ -888,7 +876,7 @@ class DatabaseMssql extends DatabaseBase {
         */
        function getServerVersion() {
                $row = mssql_fetch_row(mssql_query('select @@VERSION'));
-               return ereg("^(.+[0-9]+\\.[0-9]+\\.[0-9]+) ",$row[0],$m) ? $m[1] : $row[0];
+               return preg_match("/^(.+[0-9]+\\.[0-9]+\\.[0-9]+) /",$row[0],$m) ? $m[1] : $row[0];
        }
 
        function limitResultForUpdate($sql, $num) {