Quote from: garryn at Oct 06, 2006, 07:43 AM
if (!function_exists('getchunk')) {
// insert getchunk function
}
I’m not sure if the snippet uses any other functions as I haven’t looked at it to be honest. But, if it does, then repeat the same process for all the function declarations in the snippet.
Doing this returns a similar error for another function (freeCommonVars):
[tt]Fatal error: Cannot redeclare freecommonvars() (previously declared in /user0/htdocs/modx/manager/includes/document.parser.class.inc.php(724) : eval()’d code:322) in/user0/htdocs/modx/manager/includes/document.parser.class.inc.php(724) : eval()’d code on line 327[/tt]
Treating this other function with
if (!function_exists('freeCommonVars')) {
// insert freeCommonVars function
}
returns:
[tt]Fatal error: Call to undefined function freeCommonVars() in /user0/htdocs/modx/manager/includes/document.parser.class.inc.php(724) : eval()’d code on line 241[/tt]
these 2 errors are now generated by any page of the site, not just when calling the snippet (??!?)
...reverting the snippet to its original state and leaving it alone for the week-end!