diff options
author | Paladox <thomasmulhall410@yahoo.com> | 2017-05-24 22:20:55 +0000 |
---|---|---|
committer | Paladox <thomasmulhall410@yahoo.com> | 2017-05-24 22:20:55 +0000 |
commit | a0a471568f68a0e54f3dce2c467d8ec25531d3f5 (patch) | |
tree | ccef835240152f568844da7d609a5c8042b6f679 /includes/installer/MysqlInstaller.php | |
parent | a7b9cc4946a2f7fb081f64d9230bf944736a185b (diff) | |
download | mediawikicore-a0a471568f68a0e54f3dce2c467d8ec25531d3f5.tar.gz mediawikicore-a0a471568f68a0e54f3dce2c467d8ec25531d3f5.zip |
Revert "Revert "Fix the web updater""
This reverts commit a7b9cc4946a2f7fb081f64d9230bf944736a185b.
Change-Id: I91d4b821df126703f83377dd8aff3a79b629f720
Diffstat (limited to 'includes/installer/MysqlInstaller.php')
-rw-r--r-- | includes/installer/MysqlInstaller.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 09051f410d2f..4f0b66c1d4a7 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -179,8 +179,8 @@ class MysqlInstaller extends DatabaseInstaller { # Determine existing default character set if ( $conn->tableExists( "revision", __METHOD__ ) ) { - $revision = $conn->buildLike( $this->getVar( 'wgDBprefix' ) . 'revision' ); - $res = $conn->query( "SHOW TABLE STATUS $revision", __METHOD__ ); + $revision = $this->escapeLikeInternal( $this->getVar( 'wgDBprefix' ) . 'revision', '\\' ); + $res = $conn->query( "SHOW TABLE STATUS LIKE '$revision'", __METHOD__ ); $row = $conn->fetchObject( $res ); if ( !$row ) { $this->parent->showMessage( 'config-show-table-status' ); @@ -222,6 +222,16 @@ class MysqlInstaller extends DatabaseInstaller { } /** + * @param string $s + * @return string + */ + protected function escapeLikeInternal( $s, $escapeChar = '`' ) { + return str_replace( [ $escapeChar, '%', '_' ], + [ "{$escapeChar}{$escapeChar}", "{$escapeChar}%", "{$escapeChar}_" ], + $s ); + } + + /** * Get a list of storage engines that are available and supported * * @return array |