Skip to content

Instantly share code, notes, and snippets.

@yellowback
Created June 27, 2013 10:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yellowback/5875492 to your computer and use it in GitHub Desktop.
Save yellowback/5875492 to your computer and use it in GitHub Desktop.
FIX for PHP 5.5.0
diff --git a/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php b/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php
index 37ceae6..532937b 100644
--- a/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php
+++ b/plugins/serendipity_event_nl2br/serendipity_event_nl2br.php
@@ -152,8 +152,12 @@ class serendipity_event_nl2br extends serendipity_event
}
function restore($text) {
- global $_buf;
- return preg_replace('~\001(\d+)~e', '$_buf[$1]', $text);
+ return preg_replace_callback('~\001(\d+)~',
+ function ($m) {
+ global $_buf;
+ return strtoupper($_buf[$m[1]]);
+ },
+ $text);
}
function event_hook($event, &$bag, &$eventData, $addData = null) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment