From 25140f90a1293aec389adbb871cbf0c4dccf2a5a Mon Sep 17 00:00:00 2001 From: Li Date: Tue, 20 Sep 2022 01:47:02 +1200 Subject: [PATCH 1/6] Fix replace --- header.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/header.php b/header.php index 36bbb44..92910d4 100755 --- a/header.php +++ b/header.php @@ -89,6 +89,9 @@ $description = "PSMReborn is the largest archive of PlayStation Mobile content on the internet containing Games, SDK's, Source Code, and Unity for PSM exporters."; } + $descsocial = str_replace("
", PHP_EOL, $description); + $descsocial = str_replace("
", PHP_EOL, $description); + $descsocial = str_replace("
", PHP_EOL, $description); $descsocial = str_replace("
", PHP_EOL, $description); $descsocial = str_replace('"', '\\"', $descsocial); /* From 2214aa815420214721ecb4556764a8ba9fd96e3d Mon Sep 17 00:00:00 2001 From: Li Date: Tue, 20 Sep 2022 01:48:23 +1200 Subject: [PATCH 2/6] Fix Replace --- header.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/header.php b/header.php index 92910d4..80ad834 100755 --- a/header.php +++ b/header.php @@ -90,9 +90,9 @@ } $descsocial = str_replace("
", PHP_EOL, $description); - $descsocial = str_replace("
", PHP_EOL, $description); - $descsocial = str_replace("
", PHP_EOL, $description); - $descsocial = str_replace("
", PHP_EOL, $description); + $descsocial = str_replace("
", PHP_EOL, $descsocial); + $descsocial = str_replace("
", PHP_EOL, $descsocial); + $descsocial = str_replace("
", PHP_EOL, $descsocial); $descsocial = str_replace('"', '\\"', $descsocial); /* * Write metadata From 088e455c8ab9708b4c5e66ad168d6e854d89efce Mon Sep 17 00:00:00 2001 From: Li Date: Tue, 20 Sep 2022 01:50:06 +1200 Subject: [PATCH 3/6] Add HTMLSpecialChars --- header.php | 1 + 1 file changed, 1 insertion(+) diff --git a/header.php b/header.php index 80ad834..332f412 100755 --- a/header.php +++ b/header.php @@ -94,6 +94,7 @@ $descsocial = str_replace("
", PHP_EOL, $descsocial); $descsocial = str_replace("
", PHP_EOL, $descsocial); $descsocial = str_replace('"', '\\"', $descsocial); + $descsocial = htmlspecialchars($descsocial, ENT_QUOTES); /* * Write metadata */ From 47d6807490f67d4f6401b5d61e2fb8aff150b6e3 Mon Sep 17 00:00:00 2001 From: Li Date: Tue, 20 Sep 2022 01:51:42 +1200 Subject: [PATCH 4/6] Encode Quotes --- header.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/header.php b/header.php index 332f412..0d5ac0e 100755 --- a/header.php +++ b/header.php @@ -93,8 +93,8 @@ $descsocial = str_replace("
", PHP_EOL, $descsocial); $descsocial = str_replace("
", PHP_EOL, $descsocial); $descsocial = str_replace("
", PHP_EOL, $descsocial); - $descsocial = str_replace('"', '\\"', $descsocial); - $descsocial = htmlspecialchars($descsocial, ENT_QUOTES); + $descsocial = str_replace('"', '\"', $descsocial); + $descsocial = str_replace("'", "\'", $descsocial); /* * Write metadata */ From 80c12c33bd17e1f9f694cafb481c48104208c277 Mon Sep 17 00:00:00 2001 From: Li Date: Tue, 20 Sep 2022 01:54:46 +1200 Subject: [PATCH 5/6] add htmlspecialchars back --- header.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/header.php b/header.php index 0d5ac0e..1fb0d82 100755 --- a/header.php +++ b/header.php @@ -62,7 +62,7 @@ $game = str_replace("*", "",$game); $title = getTitle($game); $description = $title . " - "; - $description .= getDesc($game)." - "; + $description .= getDesc($game); $description .= " - PSMReborn #1 place for all PSM Content"; $image .= 'http://'.$_SERVER['HTTP_HOST'].'/gameinfo/'.$game.'/icon_512x512.png'; } @@ -95,6 +95,9 @@ $descsocial = str_replace("
", PHP_EOL, $descsocial); $descsocial = str_replace('"', '\"', $descsocial); $descsocial = str_replace("'", "\'", $descsocial); + + $descsocial = htmlspecialchars($descsocial, ENT_QUOTES); + /* * Write metadata */ From 8814a2c3c6b46dcab5997402136924362b36a620 Mon Sep 17 00:00:00 2001 From: Li Date: Tue, 20 Sep 2022 01:55:54 +1200 Subject: [PATCH 6/6] try fix description again --- header.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/header.php b/header.php index 1fb0d82..e100cf7 100755 --- a/header.php +++ b/header.php @@ -93,10 +93,9 @@ $descsocial = str_replace("
", PHP_EOL, $descsocial); $descsocial = str_replace("
", PHP_EOL, $descsocial); $descsocial = str_replace("
", PHP_EOL, $descsocial); - $descsocial = str_replace('"', '\"', $descsocial); - $descsocial = str_replace("'", "\'", $descsocial); + $descsocial = str_replace('"', '', $descsocial); + $descsocial = str_replace("'", "", $descsocial); - $descsocial = htmlspecialchars($descsocial, ENT_QUOTES); /* * Write metadata