Explorar o código

Fix cache delete for global dialplans

Greenbea %!s(int64=4) %!d(string=hai) anos
pai
achega
09dfdc78fe
Modificáronse 1 ficheiros con 7 adicións e 5 borrados
  1. 7 5
      resources/classes/cache.php

+ 7 - 5
resources/classes/cache.php

@@ -145,11 +145,13 @@ class cache {
 					event_socket_request($fp, $event);
 					event_socket_request($fp, $event);
 
 
 				//remove the local files
 				//remove the local files
-					if (file_exists($_SESSION['cache']['location']['text'] . "/" . $key)) {
-						unlink($_SESSION['cache']['location']['text'] . "/" . $key);
-					}
-					if (file_exists($_SESSION['cache']['location']['text'] . "/" . $key . ".tmp")) {
-						unlink($_SESSION['cache']['location']['text'] . "/" . $key . ".tmp");
+					foreach (glob($_SESSION['cache']['location']['text'] . "/" . $key) as $file) {
+						if (file_exists($file)) {
+							unlink($file);
+						}
+						if (file_exists($file)) {
+							unlink($file . ".tmp");
+						}
 					}
 					}
 			}
 			}