Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
documentation
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
23 Aug 2016 at 10:48 UTC
Updated:
4 Jun 2020 at 11:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
joachim commentedComment #3
rashid_786 commentedAccording to you it should be without 'e' option like the following line?
$text = preg_replace('|<code>(.+?)|s', "[codefilter_code]$1[/codefilter_code]", $text);Comment #4
joachim commentedYup, that looks fine. The 'e' option wasn't doing anything anyway, since the replacement parameter isn't executable code.
Comment #5
shashikant_chauhan commentedadding patch.
Comment #6
shashikant_chauhan commentedComment #8
sutharsan commentedComment #9
lhuria94 commentedRemove preg_replace() & se as it is deprecated and suggested to preg_replace_callback().
Comment #10
lhuria94 commentedComment #11
joachim commentedThese don't need to be preg_replace_callback() -- AFAICT there is no executable code in the replacement.
Comment #12
lhuria94 commentedUpdated patch. Ignore previous one please.
Comment #13
lhuria94 commentedComment #14
somersoft commentedComment #15
longwaveClosed the following as duplicates:
#2843864: Examples in filter.api.php use deprecated regular expression modifier "e"
#2943290: filter.api.php is insecure and does not pass php7 tests
#3006195: Error with PHP7
Comment #16
longwaveSuggested patch looks fine to me, I agree with #11, and ultimately it doesn't really matter as this is just sample code in documentation, it's not really used for anything.
Comment #17
john morahan commented#12 doesn't look right to me...
\s*<br />as a modifier? And I get a warning if I try to run it:preg_replace(): Unknown modifier '\'Comment #18
sjerdoPatch #5 looks good to me.
Rebased patch #5.
Comment #19
dan2k3k4 commentedLooks good to me.
Comment #20
ravikk-drupal commentedComment #21
ravikk-drupal commentedThis patch perfectly works for me. Screenshot attached for the same.
Comment #22
joseph.olstadComment #23
avpadernoComment #24
mcdruid commentedLGTM
Comment #25
liam morlandComment #26
fabianx commentedApproved, RTBM.
Let's get this in!
Comment #27
fabianx commentedComment #29
mcdruid commentedThank you!