[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add quotes to comment based strip markers
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/396392 ) Change subject: Add quotes to comment based strip markers .. Add quotes to comment based strip markers Bug: T180159 Change-Id: Ic9dbb8ef3948fe751d16c3963769b616b5db2fc7 --- M includes/parser/LinkHolderArray.php M includes/parser/Parser.php 2 files changed, 12 insertions(+), 12 deletions(-) Approvals: Brian Wolff: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index bc5182c..816f7f7 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -134,7 +134,7 @@ $maxId = $newKey > $maxId ? $newKey : $maxId; } } - $texts = preg_replace_callback( '/()/', + $texts = preg_replace_callback( '/()/', [ $this, 'mergeForeignCallback' ], $texts ); # Renumber interwiki links @@ -143,7 +143,7 @@ $this->interwikis[$newKey] = $entry; $maxId = $newKey > $maxId ? $newKey : $maxId; } - $texts = preg_replace_callback( '/()/', + $texts = preg_replace_callback( '/()/', [ $this, 'mergeForeignCallback' ], $texts ); # Set the parent link ID to be beyond the highest used ID @@ -172,7 +172,7 @@ # Internal links $pos = 0; while ( $pos < strlen( $text ) ) { - if ( !preg_match( '//', + if ( !preg_match( '//', $text, $m, PREG_OFFSET_CAPTURE, $pos ) ) { break; @@ -186,7 +186,7 @@ # Interwiki links $pos = 0; while ( $pos < strlen( $text ) ) { - if ( !preg_match( '//', $text, $m, PREG_OFFSET_CAPTURE, $pos ) ) { + if ( !preg_match( '//', $text, $m, PREG_OFFSET_CAPTURE, $pos ) ) { break; } $key = $m[1][0]; @@ -249,12 +249,12 @@ // Use a globally unique ID to keep the objects mergable $key = $this->parent->nextLinkID(); $this->interwikis[$key] = $entry; - $retVal = "{$trail}"; + $retVal = "{$trail}"; } else { $key = $this->parent->nextLinkID(); $ns = $nt->getNamespace(); $this->internals[$ns][$key] = $entry; - $retVal = "{$trail}"; + $retVal = "{$trail}"; } $this->size++; } @@ -374,7 +374,7 @@ $title = $entry['title']; $query = isset( $entry['query'] ) ? $entry['query'] : []; $key = "$ns:$index"; - $searchkey = ""; + $searchkey = ""; $displayText = $entry['text']; if ( isset( $entry['selflink'] ) ) { $replacePairs[$searchkey] = Linker::makeSelfLinkObj( $title, $displayText, $query ); @@ -408,7 +408,7 @@ # Do the thing $text = preg_replace_callback( - '/()/', + '/()/', $replacer->cb(), $text ); @@ -437,7 +437,7 @@ $replacer = new HashtableReplacer( $replacePairs, 1 ); $text = preg_replace_callback( - '//', + '//', $replacer->cb(), $text ); } @@ -612,7 +612,7 @@ */ public function replaceText( $text ) { $text = preg_replace_callback( - '//', + '//', [ $this, 'replaceTextCallback' ], $text ); diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 3548da9..ea58acc 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3944,7 +3944,7 @@ $this->mForceTocPosition = true; # Set a placeholder. At the end we'll fill it in with the TOC. - $text = $mw->replace( '', $text, 1 ); + $text = $mw->replace( '', $text, 1 ); # Only keep the
[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Add quotes to comment based strip markers
Phantom42 has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/396392 ) Change subject: Add quotes to comment based strip markers .. Add quotes to comment based strip markers Bug: T180159 Change-Id: Ic9dbb8ef3948fe751d16c3963769b616b5db2fc7 --- M includes/parser/LinkHolderArray.php M includes/parser/Parser.php 2 files changed, 12 insertions(+), 12 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/92/396392/1 diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index bc5182c..816f7f7 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -134,7 +134,7 @@ $maxId = $newKey > $maxId ? $newKey : $maxId; } } - $texts = preg_replace_callback( '/()/', + $texts = preg_replace_callback( '/()/', [ $this, 'mergeForeignCallback' ], $texts ); # Renumber interwiki links @@ -143,7 +143,7 @@ $this->interwikis[$newKey] = $entry; $maxId = $newKey > $maxId ? $newKey : $maxId; } - $texts = preg_replace_callback( '/()/', + $texts = preg_replace_callback( '/()/', [ $this, 'mergeForeignCallback' ], $texts ); # Set the parent link ID to be beyond the highest used ID @@ -172,7 +172,7 @@ # Internal links $pos = 0; while ( $pos < strlen( $text ) ) { - if ( !preg_match( '//', + if ( !preg_match( '//', $text, $m, PREG_OFFSET_CAPTURE, $pos ) ) { break; @@ -186,7 +186,7 @@ # Interwiki links $pos = 0; while ( $pos < strlen( $text ) ) { - if ( !preg_match( '//', $text, $m, PREG_OFFSET_CAPTURE, $pos ) ) { + if ( !preg_match( '//', $text, $m, PREG_OFFSET_CAPTURE, $pos ) ) { break; } $key = $m[1][0]; @@ -249,12 +249,12 @@ // Use a globally unique ID to keep the objects mergable $key = $this->parent->nextLinkID(); $this->interwikis[$key] = $entry; - $retVal = "{$trail}"; + $retVal = "{$trail}"; } else { $key = $this->parent->nextLinkID(); $ns = $nt->getNamespace(); $this->internals[$ns][$key] = $entry; - $retVal = "{$trail}"; + $retVal = "{$trail}"; } $this->size++; } @@ -374,7 +374,7 @@ $title = $entry['title']; $query = isset( $entry['query'] ) ? $entry['query'] : []; $key = "$ns:$index"; - $searchkey = ""; + $searchkey = ""; $displayText = $entry['text']; if ( isset( $entry['selflink'] ) ) { $replacePairs[$searchkey] = Linker::makeSelfLinkObj( $title, $displayText, $query ); @@ -408,7 +408,7 @@ # Do the thing $text = preg_replace_callback( - '/()/', + '/()/', $replacer->cb(), $text ); @@ -437,7 +437,7 @@ $replacer = new HashtableReplacer( $replacePairs, 1 ); $text = preg_replace_callback( - '//', + '//', $replacer->cb(), $text ); } @@ -612,7 +612,7 @@ */ public function replaceText( $text ) { $text = preg_replace_callback( - '//', + '//', [ $this, 'replaceTextCallback' ], $text ); diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 3548da9..ea58acc 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3944,7 +3944,7 @@ $this->mForceTocPosition = true; # Set a placeholder. At the end we'll fill it in with the TOC. - $text = $mw->replace( '', $text, 1 ); + $text = $mw->replace( '', $text, 1 ); # Only keep the first