HomePhabricator

Add OutputPage::wrapWikiTextAsInterface() to safely wrap wikitext
2284a446ba74Unpublished

Unpublished Commit · Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Add OutputPage::wrapWikiTextAsInterface() to safely wrap wikitext

This patch introduces a new method,
OutputPage::wrapWikiTextAsInterface(), which wraps the result of
OutputPage::addWikiTextAsInterface() in a tidy and robust way that
won't break if the wrapped message contains double newlines, extra
</div>, or other nasties.

This replaces a common unsafe pattern:

$output->addWikiText( '<div class="..."' .... '</div>' );

Bug: T205624
Change-Id: I1040c7cf0ec1f5c4bef7c06d4486f50d85f2dc0f
(cherry picked from commit d404b76510057c3fc4151f51bf6630ae27f6a57b)

Details

Provenance
cscottAuthored on Sep 27 2018, 3:04 PM
Jdforrester-WMFCommitted on Oct 17 2018, 5:01 AM
Parents
rMW28aa01908cff: INSTALL, UPGRADE: Re-wrap to 80 chars and enforce
Branches
Unknown
Tags
Unknown
ChangeId
I1040c7cf0ec1f5c4bef7c06d4486f50d85f2dc0f