Seite 1 von 1

kleiner bug in "contenido/includes/functions.general.ph

Verfasst: So 4. Dez 2005, 14:19
von herm
in der "function recursive_copy($from_path, $to_path)" in line 440 der "contenido/includes/functions.general.php" wird die rekursion nach verzeichniswechsel am ende mit leere variable angesprungen, und erzeugt die fehlermeldungen (Warning: copy(/www/htdocs/v119307/kunden_cms/contenido/kunden/max/images): failed to open stream: Ist ein Verzeichnis in /www/htdocs/v119307/kunden_cms/contenido/contenido/includes/functions.general.php on line 462 )

wenn man den code dahingehend ändert (else - schleife) sind die meldungen weg:




while (($myfile = readdir($myhandle)) !== false)
{
if (($myfile != ".") && ($myfile != ".."))
{
if (is_dir($myfile))
{
recursive_copy($from_path.$myfile."/", $to_path.$myfile."/");
chdir($from_path);
}
else
{
if (file_exists($myfile))
{
copy($from_path.$myfile, $to_path.$myfile);
}
}

}
}

Verfasst: So 4. Dez 2005, 14:44
von emergence
ich hab einen split of gemacht von
-> http://contenido.org/forum/viewtopic.php?t=10474

Etwas sauberer....

Verfasst: Mi 29. Mär 2006, 10:40
von rethus
PS: Danke für den tollen Tip, hat mir echt weitergeholfen.

Vielleicht etwas übersichtlicher und sauberer könnte man das so machen:

anstatt:
else
{
if (file_exists($myfile))
{
copy($from_path.$myfile, $to_path.$myfile);
}
}

einfach:

elseif (file_exists($myfile))
{
copy($from_path.$myfile, $to_path.$myfile);
}

Verfasst: Mo 12. Jun 2006, 09:15
von HerrB
Done.

Gruß
HerrB