Kaynağa Gözat

Fix minor backslashes (#8292)

Alexandre Alapetite 3 ay önce
ebeveyn
işleme
19975c22ec

+ 1 - 1
app/Controllers/javascriptController.php

@@ -61,7 +61,7 @@ class FreshRSS_javascript_Controller extends FreshRSS_ActionController {
 	 */
 	 */
 	public function nonceAction(): void {
 	public function nonceAction(): void {
 		header('Content-Type: application/json; charset=UTF-8');
 		header('Content-Type: application/json; charset=UTF-8');
-		header('Last-Modified: ' . gmdate('D, d M Y H:i:s \G\M\T'));
+		header('Last-Modified: ' . gmdate('D, d M Y H:i:s \\G\\M\\T'));
 		header('Expires: 0');
 		header('Expires: 0');
 		header('Cache-Control: private, no-cache, no-store, must-revalidate');
 		header('Cache-Control: private, no-cache, no-store, must-revalidate');
 		header('Pragma: no-cache');
 		header('Pragma: no-cache');

+ 1 - 1
app/Models/DatabaseDAO.php

@@ -254,7 +254,7 @@ SQL;
 		$values = [':table_schema' => $db['base']];
 		$values = [':table_schema' => $db['base']];
 		if (!$all) {
 		if (!$all) {
 			$sql .= ' AND table_name LIKE :table_name';
 			$sql .= ' AND table_name LIKE :table_name';
-			$values[':table_name'] = addcslashes($this->pdo->prefix(), '%_') . '%';
+			$values[':table_name'] = addcslashes($this->pdo->prefix(), '\\%_') . '%';
 		}
 		}
 		$res = $this->fetchColumn($sql, 0, $values);
 		$res = $this->fetchColumn($sql, 0, $values);
 		return isset($res[0]) ? (int)($res[0]) : -1;
 		return isset($res[0]) ? (int)($res[0]) : -1;

+ 3 - 3
lib/http-conditional.php

@@ -94,7 +94,7 @@ function httpConditional(int $UnixTimeStamp, int $cacheSeconds = 0, int $cachePr
 	$nbCond = 0;
 	$nbCond = 0;
 
 
 	//rfc2616-sec3.html#sec3.3.1
 	//rfc2616-sec3.html#sec3.3.1
-	$dateLastModif = gmdate('D, d M Y H:i:s \G\M\T', $UnixTimeStamp);
+	$dateLastModif = gmdate('D, d M Y H:i:s \\G\\M\\T', $UnixTimeStamp);
 	$dateCacheClient = 'Thu, 10 Jan 1980 20:30:40 GMT';
 	$dateCacheClient = 'Thu, 10 Jan 1980 20:30:40 GMT';
 
 
 	//rfc2616-sec14.html#sec14.19 //='"0123456789abcdef0123456789abcdef"'
 	//rfc2616-sec14.html#sec14.19 //='"0123456789abcdef0123456789abcdef"'
@@ -169,7 +169,7 @@ function httpConditional(int $UnixTimeStamp, int $cacheSeconds = 0, int $cachePr
 			else $cache = '';
 			else $cache = '';
 			$cache .= 'max-age=' . floor($cacheSeconds);
 			$cache .= 'max-age=' . floor($cacheSeconds);
 		}
 		}
-		//header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T',time()+$cacheSeconds)); //HTTP/1.0 //rfc2616-sec14.html#sec14.21
+		//header('Expires: '.gmdate('D, d M Y H:i:s \\G\\M\\T',time()+$cacheSeconds)); //HTTP/1.0 //rfc2616-sec14.html#sec14.21
 		header('Cache-Control: ' . $cache); //rfc2616-sec14.html#sec14.9
 		header('Cache-Control: ' . $cache); //rfc2616-sec14.html#sec14.9
 		header('Last-Modified: ' . $dateLastModif);
 		header('Last-Modified: ' . $dateLastModif);
 		header('Etag: ' . $etagServer);
 		header('Etag: ' . $etagServer);
@@ -204,7 +204,7 @@ function httpConditionalRefresh(int $UnixTimeStamp): void {
 	elseif (is_string($_SERVER['PATH_TRANSLATED'] ?? null)) $scriptName = $_SERVER['PATH_TRANSLATED'];
 	elseif (is_string($_SERVER['PATH_TRANSLATED'] ?? null)) $scriptName = $_SERVER['PATH_TRANSLATED'];
 	else return;
 	else return;
 
 
-	$dateLastModif = gmdate('D, d M Y H:i:s \G\M\T', $UnixTimeStamp);
+	$dateLastModif = gmdate('D, d M Y H:i:s \\G\\M\\T', $UnixTimeStamp);
 
 
 	if (is_string($_SERVER['QUERY_STRING'] ?? null)) $myQuery = '?' . $_SERVER['QUERY_STRING'];
 	if (is_string($_SERVER['QUERY_STRING'] ?? null)) $myQuery = '?' . $_SERVER['QUERY_STRING'];
 	else $myQuery = '';
 	else $myQuery = '';