[Scummvm-git-logs] scummvm-web master -> 66ea195315811198bebce30bd32689a725a041ac

Thunderforge noreply at scummvm.org
Sat Mar 5 21:38:09 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .

Summary:
66ea195315 WEB: Escaping special characters in the entire caption (#216)


Commit: 66ea195315811198bebce30bd32689a725a041ac
    https://github.com/scummvm/scummvm-web/commit/66ea195315811198bebce30bd32689a725a041ac
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2022-03-05T15:38:07-06:00

Commit Message:
WEB: Escaping special characters in the entire caption (#216)

Fixes an issue where the caption of `King's Quest I: Quest for the Crown (2.0F 1987-05-05 5.25"/3.5"/DOS/English)` was truncated to `King's Quest I: Quest for the Crown (2.0F 1987-05-05 5.25`.

Changed paths:
    include/OrmObjects/Screenshot.php


diff --git a/include/OrmObjects/Screenshot.php b/include/OrmObjects/Screenshot.php
index 9c4a88f0..a174e41d 100644
--- a/include/OrmObjects/Screenshot.php
+++ b/include/OrmObjects/Screenshot.php
@@ -68,7 +68,7 @@ class Screenshot extends BaseScreenshot
     public function getCaption()
     {
         // Escape quotes and such in the name, such as for `Spy Fox in "Dry Cereal"`
-        $name = htmlspecialchars($this->getGame()->getName());
+        $name = $this->getGame()->getName();
         $extras = [];
         if ($this->getVariant()) {
             $extras[] = $this->getVariant();
@@ -82,10 +82,10 @@ class Screenshot extends BaseScreenshot
 
         if (count($extras) > 0) {
             $extra = \join("/", $extras);
-            return "$name ($extra)";
+            return htmlspecialchars("$name ($extra)");
         }
 
-        return $name;
+        return htmlspecialchars($name);
     }
 
     public function __toString()




More information about the Scummvm-git-logs mailing list