WBCE CMS – Way Better Content Editing.
You are not logged in.
Pages: 1
Hi
I use WBCE 1.4. on WAMP with PFP 7.0.10.
When adding page of Menu Link type following warning appears:
Warning: strpos(): Empty needle in D:\WAMP\www\....\modules\menu_link\modify.php on line 107
Menu link is created and everything is working correctly despite the warning that appears during adding link.
Is there something in the code of menu link module that can be corrected?
Regards
Gawi
Offline
I can't reprocuce this error. I guess it appears only on local testing environments, not on real live webservers.
Sorgen sind wie Nudeln: man macht sich meist zu viele.
Offline
It does not appear on real serwer. But on live webserwer warnings are hidden.
Gawi
Offline
But on live webserwer warnings are hidden.
Not necessary. I have activated at settings > advanced options > php error reporting to "Show all errors" (and that online testing environement is able to show warnings and errors an does not suppress them), and I still don't get that warning. I also tried at general settings disabling manage sections / section blocks, set the section-anchor string to empty string and decreased PHP to 7.0.32 (the lowest version available), but still no warning appears.
The strange thing about the warning: Line 107 reads
if (strpos($aData['anchor'], SEC_ANCHOR) !== false){
and the needle is the constant SEC_ANCHOR. But why can it be empty ln some cases?
Last edited by florian (06.10.2019 23:46:58)
Sorgen sind wie Nudeln: man macht sich meist zu viele.
Offline
Hm ...
error confirmed - WBCE 1.4.0 - MAMP PHP 7.3.8 (xd 2.7.2) - local ...
The problem is that SEC_ANCHOR holds an empty string ("") ...
and in the "line 107" we/you are trying to find an empty string inside a given source ...
so - a quick one/fix could be
File: ~/modules/menu_link/modify.php
Line: ~107
[== PHP ==]
if ((SEC_ANCHOR!="") && (strpos($aData['anchor'], SEC_ANCHOR) !== false)){
to test also if the SEC_ANCHOR is "empty" ...
kind regards
Kant
Sapere aude!
Offline
stefanek
Thank you. It works. No warnings!
Gawi
Offline
Now fixed on GitHub.
Offline
stefanek