Skip to content

Commit 6e34b29

Browse files
committed
fix: escape meta description
1 parent 11b39bb commit 6e34b29

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/index.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ function downloadBatch(array $urls) {
295295
$meta_file = realpath($local_path . '/' . $file . '.dbmeta.json');
296296
if ($meta_file !== false) {
297297
$meta = json_decode(file_get_contents($meta_file));
298+
if (isset($meta->description)) { // escape meta->description
299+
$meta->description = htmlspecialchars($meta->description, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
300+
}
298301
if ($meta !== null && $meta->hidden === true) continue;
299302
} else {
300303
// Variables stay alive in php so we need to reset it explicitly

0 commit comments

Comments
 (0)