Last modified: 2014-10-16 12:00:19 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T68706, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 66706 - [HTMLets] Deprecated preg_replace(): The /e modifier is deprecated in HTMLets
[HTMLets] Deprecated preg_replace(): The /e modifier is deprecated in HTMLets
Status: PATCH_TO_REVIEW
Product: MediaWiki extensions
Classification: Unclassified
Other (Other open bugs)
REL1_22-branch
All All
: Lowest normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-06-17 10:16 UTC by jongfeli
Modified: 2014-10-16 12:00 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
HTMLets.php patch (543 bytes, patch)
2014-06-18 06:40 UTC, jongfeli
Details

Description jongfeli 2014-06-17 10:16:01 UTC
When using the HTMLets extension with PHP 5.5.13 you get the following warning: "Depricated preg_replace(): The /e modifier is deprecated, use preg_replace_callback() instead"

Not sure if the code is correct but replacing the function wfRenderHTMLetHackPostProcess in HTMLets.php starting on line 134 with the below code solves the problem. Not sure if the code is correct. Code taken from https://www.mediawiki.org/wiki/Extension_talk:HTMLets#Deprecated:_preg_replace.28.29:_The_.2Fe_modifier_is_deprecated.2C_use_preg_replace_callback_instead_30458



function wfRenderHTMLetHackPostProcess( $parser, &$text ) {
	$text = preg_replace_callback(
		'/<!-- @HTMLetsHACK@ ([0-9a-zA-Z\\+\\/]+=*) @HTMLetsHACK@ -->/sm',
		function ($m) {
			return base64_decode("$m[1]");
		},
		$text
	);

	return true;
}
Comment 1 Andre Klapper 2014-06-17 13:08:11 UTC
Thanks for your report!
CC'ing the maintainer of https://www.mediawiki.org/wiki/Extension:HTMLets

In case you feel like cooking up a patch,
you are welcome to use Developer access
  https://www.mediawiki.org/wiki/Developer_access
to submit this as a Git branch directly into Gerrit:
  https://www.mediawiki.org/wiki/Git/Tutorial
Putting your branch in Git makes it easier to review it quickly. If you don't want to set up Git/Gerrit, you can also use https://tools.wmflabs.org/gerrit-patch-uploader/
Comment 2 jongfeli 2014-06-18 06:40:09 UTC
Created attachment 15681 [details]
HTMLets.php patch
Comment 3 Gerrit Notification Bot 2014-06-18 06:41:53 UTC
Change 140311 had a related patch set uploaded by Gerrit Patch Uploader:
HTMLets.php patch

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links