In the Devel module, php E_NOTICE warnings are now exposed, in an attempt to tighten up coding practices and improve readability and reliability of contrib modules - #970688: How to treat E_NOTICE in backtrace_error_handler()? has the details.

weblinks_filter_process() produces

notice: Undefined variable: search in weblinks_filter_process()
(line 104 of .../sites/all/modules/weblinks/contribs/weblinks_filter/weblinks_filter.module)
notice: Undefined variable: replace in weblinks_filter_process()
(line 104 of .../sites/all/modules/weblinks/contribs/weblinks_filter/weblinks_filter.module)

I have a patch which I will submit.

Jonathan

Comments

jonathan1055’s picture

Status: Active » Needs review
StatusFileSize
new509 bytes

The problem was attempting

return str_replace($search, $replace, $text);

when there was no match in the preg_match_all() call at the top of the function.

Here is a patch for your consideration, where the return is just the $text if no match was found.

jonathan1055’s picture

Version: 6.x-2.3 » 6.x-2.5
StatusFileSize
new94.25 KB

Hi,
Any chance of someone reviewing this and then we can get it committed. Now that we have a good working latest release, it would be nice to avoid these e_notice warnings.
The patch above still applies ok, with a one-line offset. Attached is a view of the code changes - old on the left and new on the right.

Jonathan

nancydru’s picture

Status: Needs review » Fixed

Committed. Thanks for the patch.

Status: Fixed » Closed (fixed)

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