Only expand `{{...}}` in messages once
authorC. Scott Ananian <cscott@cscott.net>
Thu, 11 Oct 2018 13:05:05 +0000 (09:05 -0400)
committerC. Scott Ananian <cscott@cscott.net>
Thu, 11 Oct 2018 13:05:05 +0000 (09:05 -0400)
If we're going to call `OutputPage::addWikiText` to parse the message,
we don't need to pre-expand `{{...}}` markup before passing it to the
parser.  This makes these callsites consistent with how
`OutputPage::addWikiMsg()` inserts messages.

Bug: T206574
Change-Id: I2f68f73365df876e6f9d017e4e3ddea39c4a1284

includes/EditPage.php

index 6b79538..7143c3f 100644 (file)
@@ -2991,7 +2991,7 @@ ERROR;
                                        $this->contentFormat,
                                        $ex->getMessage()
                                );
-                               $out->addWikiText( '<div class="error">' . $msg->text() . '</div>' );
+                               $out->addWikiText( '<div class="error">' . $msg->plain() . '</div>' );
                        }
                }
 
@@ -3466,7 +3466,7 @@ ERROR;
                                        $this->contentFormat,
                                        $ex->getMessage()
                                );
-                               $out->addWikiText( '<div class="error">' . $msg->text() . '</div>' );
+                               $out->addWikiText( '<div class="error">' . $msg->plain() . '</div>' );
                        }
                }
        }