소스 검색

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

Zachary Kotlarek 12 년 전
부모
커밋
71a7fbe6e5
1개의 변경된 파일과 6개의 추가작업 그리고 0개의 파일을 삭제
  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);