Explorar el Código

tempnam() may not return the file we want -- be sure to unlink it and translate the error

Zachary Kotlarek hace 12 años
padre
commit
71a7fbe6e5
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      web/includes/series.php

+ 6 - 0
web/includes/series.php

@@ -35,6 +35,12 @@ function allSeriesSeasons($base, $use_cache = true) {
 
 	# Always update the cache if we read from disk
 	$temp = @tempnam(dirname($CACHE_FILE), 'tv_web.cache');
+	if ($temp) {
+		if (dirname($temp) != dirname($CACHE_FILE)) {
+			unlink($temp);
+			$temp = false;
+		}
+	}
 	if ($temp) {
 		file_put_contents($temp, serialize($retval));
 		rename($temp, $CACHE_FILE);