Hi everyone after looking at my logs today I noticed there was over 20,000 log entries all the same file size and with the same error inside of them.
The error I am seeing in the log is as follows:
Code:
[12-Jul-2011 12:31:39] PHP Warning: Invalid argument supplied for foreach() in /home/my_site/public_html/includes/functions/extra_functions/jscript.php on line 71
[12-Jul-2011 12:31:39] PHP Warning: Invalid argument supplied for foreach() in /home/my_site/public_html/includes/functions/extra_functions/jscript.php on line 71
Now I have done a search through my files and this jscript.php file seems to be part of the Tab Products Pro Mod. So I am sure now that this error message is caused by this mod for some reason.
I opened up the jscript.php file and scrolled down to line 71 and this is what is on this line.
Code:
foreach($files as $file=>$order){
Here is a full listing of this section of the file starting from line 67 all the way down to line 110.
Code:
function getMinifyfiles($files, $request_string, $folder){
global $request_type, $current_page_base, $template;
$relative_path = $request_type == 'NONSSL' ? DIR_WS_CATALOG : DIR_WS_HTTPS_CATALOG;
$files_paths = '';$result = array();
foreach($files as $file=>$order){
// case 1: file is in server but full path not passed, assuming it is under corresponding template css/js folder
if($file_exists = file_exists(DIR_FS_CATALOG.DIR_WS_TEMPLATE.$folder.$file)){
$file_absolute_path = DIR_FS_CATALOG.DIR_WS_TEMPLATE.$folder.$file;
$file_relative_path = $relative_path.DIR_WS_TEMPLATE.$folder.$file;
}
// case 2: file is in the default template
elseif($file_exists = file_exists(DIR_FS_CATALOG.DIR_WS_TEMPLATES.'template_default/'.$folder.$file)){
$file_absolute_path = DIR_FS_CATALOG.DIR_WS_TEMPLATES.'template_default/'.$folder.$file;
$file_relative_path = $relative_path.DIR_WS_TEMPLATES.'template_default/'.$folder.$file;
}
// case 3: file is in the server, can be accessed via the same domain, full path passed
elseif($file_exists = file_exists($file)){
$file_absolute_path = DIR_FS_CATALOG.$file;
$file_relative_path = $relative_path.$file;
}
// case 4: file is not even on the same domain
if(substr($file, 0, 4) == 'http'){
$file_relative_path = $file;
$file_exists = true;
}
if($file_exists){
$ext = pathinfo($file, PATHINFO_EXTENSION);
// if we encounter php, unfortunately we will have to include it for now
// another solution is to put everything into 1 file, but we will have to solve @import
if($ext == 'php'){
if($files_paths != ''){
$result[] = array('string' => sprintf($request_string, trim($files_paths, ',')), 'include' => false);
$files_paths = '';
}
$result[] = array('string' => $file_absolute_path, 'include' => true);
}
else{
$files_paths .= $file_relative_path.',';
}
}
}
So does anyone have any idea what is causing this error to be posted in my error logs and can the please tell me how I can fix it?
Thanks.
Bookmarks