From: Max Semenik Date: Sat, 6 Mar 2010 16:39:31 +0000 (+0000) Subject: Fixed a couple of E_DEPRECATED in DatabaseMssql X-Git-Tag: 1.31.0-rc.0~37538 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=e78af18401fadb77a5c36bfb11991b33d1188135;p=lhc%2Fweb%2Fwiklou.git Fixed a couple of E_DEPRECATED in DatabaseMssql --- diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php index 6b1206b0d9..c115058f11 100644 --- a/includes/db/DatabaseMssql.php +++ b/includes/db/DatabaseMssql.php @@ -833,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", "SELECT TOP $limit", $sql); } return $sql; } @@ -876,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) {