Merge "Localisation updates from https://translatewiki.net."
[lhc/web/wiklou.git] / includes / db / DatabaseSqlite.php
index 3e063c6..dd2e813 100644 (file)
@@ -342,9 +342,9 @@ class DatabaseSqlite extends DatabaseBase {
         */
        function numFields( $res ) {
                $r = $res instanceof ResultWrapper ? $res->result : $res;
-               if ( is_array($r) && count( $r ) > 0 ){
+               if ( is_array( $r ) && count( $r ) > 0 ) {
                        // The size of the result array is twice the number of fields. (Bug: 65578)
-                       return count( $r[0] ) / 2 ;
+                       return count( $r[0] ) / 2;
                } else {
                        // If the result is empty return 0
                        return 0;
@@ -666,7 +666,7 @@ class DatabaseSqlite extends DatabaseBase {
        }
 
        /**
-        * @return string wikitext of a link to the server software's web site
+        * @return string Wikitext of a link to the server software's web site
         */
        public function getSoftwareLink() {
                return "[{{int:version-db-sqlite-url}} SQLite]";
@@ -873,6 +873,9 @@ class DatabaseSqlite extends DatabaseBase {
                } elseif ( preg_match( '/^\s*DROP INDEX/i', $s ) ) {
                        // DROP INDEX is database-wide, not table-specific, so no ON <table> clause.
                        $s = preg_replace( '/\sON\s+[^\s]*/i', '', $s );
+               } elseif ( preg_match( '/^\s*INSERT IGNORE\b/i', $s ) ) {
+                       // INSERT IGNORE --> INSERT OR IGNORE
+                       $s = preg_replace( '/^\s*INSERT IGNORE\b/i', 'INSERT OR IGNORE', $s );
                }
 
                return $s;