permalinks dispatcher
3 posts by 2 authors in: Forums > CMS Builder
Last Post: July 28, 2017 (RSS)
By kitsguru - July 25, 2017
On line 11/12 of the permalinks dispatcher the following line cause xDebug to halt execution with a warning that file is not found during the include operation. Even though there is @ - ignore error - so it doesn't get logged, it is still technically a warning error.
$dirsToCheck = array('../','../../','../../../','../../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
Since the plugin is down two levels from lib, there is a minor performance increase if the dirsToCheck is altered a wee bit to move the second check to the beginning.
$dirsToCheck = array('../../','../','../../../','../../../../');
By Dave - July 28, 2017
Hi Jeff,
Hmm, interesting. You could put a file_exists() check in there if it's causing a problem. We're moving away from using the error suppression operator (@) so we'll probably rewrite that generic code at some point.
Thanks for the feedback!
interactivetools.com
By kitsguru - July 28, 2017
I just moved the ../../ to the first element of the array. Glad to hear you are moving away from @ operator. Much better to adjust the code so it isn't necessary.