Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/248606

Change subject: Use DatabaseBase::addQuotes() for timestamps
......................................................................

Use DatabaseBase::addQuotes() for timestamps

Change-Id: I7aa9fa00e11955c73f61ce50c25fc6d67e03ab6e
---
M RenameUserJob.php
1 file changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Renameuser 
refs/changes/06/248606/1

diff --git a/RenameUserJob.php b/RenameUserJob.php
index 8b9d585..e483733 100644
--- a/RenameUserJob.php
+++ b/RenameUserJob.php
@@ -56,6 +56,8 @@
                $uniqueKey = isset( $this->params['uniqueKey'] ) ? 
$this->params['uniqueKey'] : null;
                $keyId = isset( $this->params['keyId'] ) ? 
$this->params['keyId'] : null;
 
+               $dbw = wfGetDB( DB_MASTER );
+
                # Conditions like "*_user_text = 'x'
                $conds = array( $column => $oldname );
                # If user ID given, add that to condition to avoid rename 
collisions
@@ -64,16 +66,14 @@
                }
                # Bound by timestamp if given
                if ( $timestampColumn !== null ) {
-                       $conds[] = "$timestampColumn >= '$minTimestamp'";
-                       $conds[] = "$timestampColumn <= '$maxTimestamp'";
+                       $conds[] = "$timestampColumn >= " . $dbw->addQuotes( 
$minTimestamp );
+                       $conds[] = "$timestampColumn <= " . $dbw->addQuotes( 
$maxTimestamp );
                # Bound by unique key if given (B/C)
                } elseif ( $uniqueKey !== null && $keyId !== null ) {
                        $conds[$uniqueKey] = $keyId;
                } else {
                        throw new InvalidArgumentException( "Expected ID batch 
or time range" );
                }
-
-               $dbw = wfGetDB( DB_MASTER );
 
                $affectedCount = 0;
                # Actually update the rows for this job...

-- 
To view, visit https://gerrit.wikimedia.org/r/248606
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7aa9fa00e11955c73f61ce50c25fc6d67e03ab6e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Renameuser
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to