Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

joachim’s picture

Title: sample for for callback_filter_process() and callback_filter_prepare() should not include deprecated regex option » sample code for callback_filter_process() and callback_filter_prepare() should not include deprecated regex option
rashid_786’s picture

According to you it should be without 'e' option like the following line?

$text = preg_replace('|<code>(.+?)|s', "[codefilter_code]$1[/codefilter_code]", $text);

joachim’s picture

Yup, that looks fine. The 'e' option wasn't doing anything anyway, since the replacement parameter isn't executable code.

shashikant_chauhan’s picture

shashikant_chauhan’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 5: 2788565-5.patch, failed testing.

Sutharsan’s picture

Issue tags: +Dublin2016
lhuria94’s picture

Remove preg_replace() & se as it is deprecated and suggested to preg_replace_callback().

lhuria94’s picture

Status: Needs work » Needs review
joachim’s picture

Status: Needs review » Needs work

These don't need to be preg_replace_callback() -- AFAICT there is no executable code in the replacement.

lhuria94’s picture

lhuria94’s picture

Status: Needs work » Needs review
somersoft’s picture

Related issues: +#3006195: Error with PHP7
longwave’s picture

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Suggested 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.

John Morahan’s picture

Status: Reviewed & tested by the community » Needs work

#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 '\'

dan2k3k4’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me.

ravikk-drupal’s picture

Assigned: Unassigned » ravikk-drupal
ravikk-drupal’s picture

FileSize
32.63 KB

This patch perfectly works for me. Screenshot attached for the same.

joseph.olstad’s picture

Issue tags: +PHP 7.4
apaderno’s picture

Assigned: ravikk-drupal » Unassigned
mcdruid’s picture

Issue tags: +Pending Drupal 7 commit

LGTM

Liam Morland’s picture

Fabianx’s picture

Approved, RTBM.

Let's get this in!

Fabianx’s picture

Assigned: Unassigned » mcdruid

  • mcdruid committed 9ed3f67 on 7.x
    Issue #2788565 by lhuria94, shashikant_chauhan, sjerdo, ravikk-drupal,...
mcdruid’s picture

Assigned: mcdruid » Unassigned
Status: Reviewed & tested by the community » Fixed
Issue tags: -Pending Drupal 7 commit

Thank you!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.