Hello Aaron Schulz, Bartosz Dziewoński, Chad, Reedy, TTO, Gergő Tisza, Legoktm,
jenkins-bot, Anomie,
I'd like you to do a code review. Please visit
https://gerrit.wikimedia.org/r/355562
to review the following change.
Change subject: Revert "Revert "Fix the web updater""
......................................................................
Revert "Revert "Fix the web updater""
This reverts commit a7b9cc4946a2f7fb081f64d9230bf944736a185b.
Change-Id: I91d4b821df126703f83377dd8aff3a79b629f720
---
M includes/installer/MysqlInstaller.php
1 file changed, 12 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/62/355562/1
diff --git a/includes/installer/MysqlInstaller.php
b/includes/installer/MysqlInstaller.php
index 09051f4..4f0b66c 100644
--- a/includes/installer/MysqlInstaller.php
+++ b/includes/installer/MysqlInstaller.php
@@ -179,8 +179,8 @@
# 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 @@
}
/**
+ * @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
--
To view, visit https://gerrit.wikimedia.org/r/355562
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I91d4b821df126703f83377dd8aff3a79b629f720
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Paladox <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Chad <[email protected]>
Gerrit-Reviewer: Gergő Tisza <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: TTO <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits