Addshore has submitted this change and it was merged. Change subject: Force internal delimiters for php regex ......................................................................
Force internal delimiters for php regex Bug: T96402 Change-Id: If345e3079c68ad80b2310050cb0c2bc925ffb113 --- M src/Targets/WikiPage/Actions/RegexRenameAction.php M src/Targets/WikiPage/Actions/RegexReplaceAction.php 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/src/Targets/WikiPage/Actions/RegexRenameAction.php b/src/Targets/WikiPage/Actions/RegexRenameAction.php index 8a4e98a..26a8270 100644 --- a/src/Targets/WikiPage/Actions/RegexRenameAction.php +++ b/src/Targets/WikiPage/Actions/RegexRenameAction.php @@ -43,7 +43,7 @@ throw new InvalidArgumentException( __METHOD__ . ' can only work on WikiPageData objects' ); } $data->setTitle( - preg_replace( $this->pattern, $this->replacement, $data->getTitle() ) + preg_replace( '/' . $this->pattern . '/', $this->replacement, $data->getTitle() ) ); return $data; } diff --git a/src/Targets/WikiPage/Actions/RegexReplaceAction.php b/src/Targets/WikiPage/Actions/RegexReplaceAction.php index 5a9d5b7..55fdeb5 100644 --- a/src/Targets/WikiPage/Actions/RegexReplaceAction.php +++ b/src/Targets/WikiPage/Actions/RegexReplaceAction.php @@ -43,7 +43,7 @@ throw new InvalidArgumentException( __METHOD__ . ' can only work on WikiPageData objects' ); } $data->setText( - preg_replace( $this->pattern, $this->replacement, $data->getText() ) + preg_replace( '/' . $this->pattern . '/', $this->replacement, $data->getText() ) ); return $data; } -- To view, visit https://gerrit.wikimedia.org/r/205302 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: If345e3079c68ad80b2310050cb0c2bc925ffb113 Gerrit-PatchSet: 3 Gerrit-Project: mediawiki/extensions/MassAction Gerrit-Branch: master Gerrit-Owner: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: Addshore <addshorew...@gmail.com> Gerrit-Reviewer: Hoo man <h...@online.de> Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits