Zen Cart Logo
Forums / Bug Reports / Don't load non-php files in admin autoloader

Don't load non-php files in admin autoloader

Locked

Views: 1,155

Results 1 to 1 of 1
This thread is locked. New replies are disabled.
6 Dec 2010, 1:27 AM
#1
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,708
Plugin Contributions:
56

Don't load non-php files in admin autoloader

Some editors (such as vi) leave droppings, swap files, etc. These files should not be loaded by the autoloaders since they don't match the pattern *.php$

This works perfectly in the catalog (editing a file in includes/functions/extra_functions doesn't break the page), but in the admin side, it fails.

The fix is simple: in admin/includes/init_includes/init_general_funcs.php, line 46, change

if (strstr($zv_file, '.php')) {

to

if (preg_match('/.php$/', $zv_file) > 0) {

Scott