Yaron Koren has uploaded a new change for review.

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

Change subject: Added initialization of variable - fix for bug 68363
......................................................................

Added initialization of variable - fix for bug 68363

Change-Id: I767b783513bd255d40cbb6ec5b97fc4071156e80
---
M ReplaceTextJob.php
1 file changed, 2 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ReplaceText 
refs/changes/66/148566/1

diff --git a/ReplaceTextJob.php b/ReplaceTextJob.php
index 201b859..bd8dd93 100644
--- a/ReplaceTextJob.php
+++ b/ReplaceTextJob.php
@@ -85,11 +85,10 @@
                        wfProfileIn( __METHOD__ . '-replace' );
                        $target_str = $this->params['target_str'];
                        $replacement_str = $this->params['replacement_str'];
-                       // @todo FIXME eh?
-                       $num_matches;
+                       $num_matches = 0;
 
                        if ( $this->params['use_regex'] ) {
-                               $new_text = preg_replace( '/'.$target_str.'/U', 
$replacement_str, $article_text, -1, $num_matches );
+                               $new_text = preg_replace( '/' . $target_str . 
'/U', $replacement_str, $article_text, -1, $num_matches );
                        } else {
                                $new_text = str_replace( $target_str, 
$replacement_str, $article_text, $num_matches );
                        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I767b783513bd255d40cbb6ec5b97fc4071156e80
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ReplaceText
Gerrit-Branch: master
Gerrit-Owner: Yaron Koren <[email protected]>

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

Reply via email to