Report any technical problems you discover and discuss solutions.

v3: bug - files/dirs/templates not being deleted

Plus d'informations
il y a 10 ans 11 mois - il y a 10 ans 11 mois #3020 par jayaich
Hello,

I created a new project, and uploaded an image to it. I then deleted the project, including selecting the 'Recycle bin' and selecting to empty that. However, I got some PHP warnings:

===========

Quelque chose est masqué pour les invités. Veuillez vous connecter ou vous enregistrer pour le visualiser.

===========

There were also a couple of further warnings, but they stemmed from the fact that the above directories were not deleted. The result is that the project directory is left on the disk.

It seems that the file 'modules/xerte/delete_template.php' is not correctly handling the full pathname, and so the test for a directory fails. The code then assumes it is a file. This in turn leads to the above errors when trying to unlink a directory. (In effect the code leaves out the directory separator when joining the parent directory to the entry being checked).

A patch for this is attached.


John.
Dernière édition: il y a 10 ans 11 mois par jayaich. Raison: Add attachment

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 10 ans 11 mois #3021 par jayaich
Réponse de jayaich sur le sujet v3: bug - files/dirs/templates not being deleted
Adding the attachment didn't work. So putting it inline again:
Code:
--- modules/xerte/delete_template.php.orig 2015-07-29 23:17:23.000000000 +0100 +++ modules/xerte/delete_template.php 2015-08-13 15:14:36.634487590 +0100 @@ -55,18 +55,17 @@ if(($f!=".")&&($f!="..")){ - if(is_dir($path . $f)){ - + $string = $path . DIRECTORY_SEPARATOR . $f; - array_push($folder_array, $path . "/" . $f); + if(is_dir($string)){ + + array_push($folder_array, $string); - delete_folder_loop($path . $f); + delete_folder_loop($string); }else{ - $string = $path . "/" . $f; - array_push($file_array, $string); } @@ -149,4 +148,4 @@ rmdir($path); } -?> \ No newline at end of file +?>

Connexion ou Créer un compte pour participer à la conversation.

Modérateurs: ronmjultenJohnSmith
Temps de génération de la page : 0.123 secondes
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo