Wenn ich vor dem if mode ein // setze und auch vor der abschliessenden Klammer ein // setze, dann funktioniert es wenigstens in der "nicht ausführlichen Version". Dann wird die big funktion auch ausgeführt.
Mir ist aufgefallen das es sich hier um die scriptversion 1.8 handelt. Wieso ist denn die Filterfunktion der Dateinamen rausgenommen worden?
* Copyright: (C) 2002 Jan Sorgalla *
* Email: jan@4homepages.de *
* Web: http://www.4homepages.de *
* Scriptversion: 1.8 *
* File version: 2.6.2 *
* *
* Never released without support from: Nicky (http://www.nicky.net) *
$log[] = "Working on <b>".MEDIA_DIR.(($old_cat_id != 0) ? "/".$old_cat_id : "")."/".stripslashes($image_media_file)."</b> file:";
if ($filter && preg_match("/( |%20|[^-\._a-zA-Z0-9])/", stripslashes($image_media_file)))
{
$image_media_file_backup = $image_media_file;
$image_media_file = stripslashes($image_media_file);
$file = str_replace(" ", "_", $image_media_file);
$file = str_replace("%20", "_", $file);
$file = preg_replace("/[^-\._a-zA-Z0-9]/", "", $file);
$oldwd = getcwd();
$n = 2;
$copy = "";
$file_name = substr($file,0,(strlen($file)-strlen(strrchr($file,"."))));
$file_ext = substr(strrchr($file,"."), 1);
chdir(realpath(MEDIA_PATH.(($old_cat_id != 0) ? "/".$old_cat_id : "")));
while (file_exists($file_name.$copy.".".$file_ext)) {
$copy = "_".$n;
$n++;
}
$file = $file_name.$copy.".".$file_ext;
if (rename(basename($image_media_file), basename($file)))
{
$log[] = str_replace("{from}", $image_media_file, str_replace("{to}", $file, $lang['cni_media_file_rename']));
$image_media_file = $file;
}
else
{
$log[] = str_replace("{from}", $image_media_file, str_replace("{to}", $file, $lang['cni_media_file_rename_error']));
$image_media_file = $image_media_file_backup;
}
chdir($oldwd);
}
if ($filter && preg_match("/( |%20|[^-\._a-zA-Z0-9])/", stripslashes($image_thumb_file)))
{
$image_thumb_file_backup = $image_thumb_file;
$image_thumb_file = stripslashes($image_thumb_file);
$file = str_replace(" ", "_", $image_thumb_file);
$file = str_replace("%20", "_", $file);
$file = preg_replace("/[^-\._a-zA-Z0-9]/", "", $file);
$oldwd = getcwd();
$n = 2;
$copy = "";
$file_name = substr($file,0,(strlen($file)-strlen(strrchr($file,"."))));
$file_ext = substr(strrchr($file,"."), 1);
chdir(realpath(THUMB_PATH.(($old_cat_id != 0) ? "/".$old_cat_id : "")));
while (file_exists($file_name.$copy.".".$file_ext)) {
$copy = "_".$n;
$n++;
}
$file = $file_name.$copy.".".$file_ext;
if (rename(basename($image_thumb_file), basename($file)))
{
$log[] = str_replace("{from}", $image_thumb_file, str_replace("{to}", $file, $lang['cni_thumb_file_rename']));
$image_thumb_file = $file;
}
else
{
$log[] = str_replace("{from}", $image_thumb_file, str_replace("{to}", $file, $lang['cni_thumb_file_rename_error']));
$image_thumb_file = $image_thumb_file_backup;
}
chdir($oldwd);
}