Supporting each other

Community forums

Welcome, Guest
Username: Password: Remember me
Report any technical problems you discover and discuss solutions.
  • Page:
  • 1

TOPIC:

Xerte 3.3: deleting templates bug? 7 years 9 months ago #4233

  • jayaich
  • jayaich's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 82
  • Thank you received: 5
Hello,

I am just starting to look through some changes we made for our Xerte 3.0 site with the intention to update it to Xerte 3.3.

The file 'modules/decision/delete_template.php' seems to handle directory checking incorrectly. This file also seems to be duplicated at 'modules/site/delete_template.php' and 'modules/xerte/delete_template.php'.

Attached is a diff file which seems to correct the problem.


John.

Please Log in or Create an account to join the conversation.

Xerte 3.3: deleting templates bug? 7 years 9 months ago #4234

  • jayaich
  • jayaich's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
  • Posts: 82
  • Thank you received: 5
Okay, It seems I can't attach files to the posts. (I'm sure I had this problem before. anyway couldn't find a solution.) so here is the diff inline:
--- modules/decision/delete_template.php.orig   2015-07-29 23:17:23.000000000 +0100
+++ modules/decision/delete_template.php        2017-02-06 16:19:12.253905013 +0000
@@ -53,18 +53,16 @@
 
                if(($f!=".")&&($f!="..")){
 
-                       if(is_dir($path . $f)){
-
+                       $string = $path . DIRECTORY_SEPARATOR . $f;
 
-                               array_push($folder_array, $path . "/" . $f);
-
-                               delete_folder_loop($path . $f);
+                       if(is_dir($string)){
 
+                               array_push($folder_array, $string);
+
+                               delete_folder_loop($string);
 
                        }else{
 
-                               $string = $path . "/" . $f;
-
                                array_push($file_array, $string);
 
                        }
@@ -147,4 +145,4 @@
        rmdir($path);
 
 }
-?>
\ No newline at end of file
+?>

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: ronmjultenJohnSmith
Time to create page: 0.046 seconds
Copyright © 2024 The Xerte Project.
Xerte logo Apereo logo OSI Logo

Search