Tpt has uploaded a new change for review. https://gerrit.wikimedia.org/r/78831
Change subject: Multiline templates aren't well escaped ...................................................................... Multiline templates aren't well escaped Change-Id: I77f667b7061e3a5bc6371e5219d04453d08273c1 --- M includes/index/EditProofreadIndexPage.php 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ProofreadPage refs/changes/31/78831/1 diff --git a/includes/index/EditProofreadIndexPage.php b/includes/index/EditProofreadIndexPage.php index 633e783..21a50d6 100644 --- a/includes/index/EditProofreadIndexPage.php +++ b/includes/index/EditProofreadIndexPage.php @@ -137,7 +137,7 @@ */ protected function importContentFormData( &$request ) { if ( $this->textbox1 !== '' ) { - return; + return $this->textbox1; } $config = ProofreadIndexPage::getDataConfig(); @@ -164,22 +164,22 @@ $value = trim( $value ); // replace pipe symbol everywhere... - $value = preg_replace( '#\|#', '&!&', $value ); + $value = preg_replace( '/\|/', '&!&', $value ); // ...except in links... $prev = ''; do { $prev = $value; - $value = preg_replace( '#\[\[(.*?)&!&(.*?)\]\]#', '[[$1|$2]]', $value ); + $value = preg_replace( '/\[\[(.*?)&!&(.*?)\]\]/', '[[$1|$2]]', $value ); } while ( $value != $prev ); // ..and in templates do { $prev = $value; - $value = preg_replace( '#\{\{(.*?)&!&(.*?)\}\}#', '{{$1|$2}}', $value ); + $value = preg_replace( '/\{\{(.*?)&!&(.*?)\}\}/s', '{{$1|$2}}', $value ); } while ( $value != $prev ); - $value = preg_replace( '#&!&#', '{{!}}', $value ); + $value = preg_replace( '/&!&/', '{{!}}', $value ); return $value; } -- To view, visit https://gerrit.wikimedia.org/r/78831 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I77f667b7061e3a5bc6371e5219d04453d08273c1 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ProofreadPage Gerrit-Branch: master Gerrit-Owner: Tpt <thoma...@hotmail.fr> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits