Page MenuHomePhabricator

Drop use of preg_replace(): with the /e modifier
Closed, ResolvedPublic

Description

1) CommonFunctionsTest::test_processWikitext_empty
preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead

2) CommonFunctionsTest::test_processWikitext_makelinks_form_1
preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
 
3) CommonFunctionsTest::test_processWikitext_makelinks_form_2
preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead
 
api/includes/CommonFunctions.php:26
api/tests/CommonFunctionsTest.php:53

[...] the regex modifier /e (which eval code) is definitely evil and I can see why it never got supported by HHVM.

Find this pattern where it occurs in the api and replace it with preg_replace_callback

Event Timeline

I've patched this but am just figuring out on top of what to rebase it.

Change 286629 had a related patch set uploaded (by Lokal Profil):
Drop use of preg_replace() with the /e modifier

https://gerrit.wikimedia.org/r/286629

Change 286629 merged by jenkins-bot:
Drop use of preg_replace() with the /e modifier

https://gerrit.wikimedia.org/r/286629