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('../../','../','../../../','../../../../');

Jeff Shields

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.

Jeff Shields