X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FObject%2FOEmbed.php;h=10204fd5227e5da0ade86ed8014271132997ca47;hb=0a4dc51bdc401f36a6eea73dc47846964d49bc00;hp=20f27ae0bf12dea38e948e06dd8fe7fc6930f73e;hpb=1fa37586caa351b3bdb44920649ba0fa90c36bd0;p=friendica.git diff --git a/src/Object/OEmbed.php b/src/Object/OEmbed.php index 20f27ae0bf..10204fd522 100644 --- a/src/Object/OEmbed.php +++ b/src/Object/OEmbed.php @@ -1,4 +1,23 @@ . + * + */ namespace Friendica\Object; @@ -42,6 +61,19 @@ class OEmbed } foreach ($properties as $key => $value) { + if (in_array($key, ['thumbnail_width', 'thumbnail_height', 'width', 'height'])) { + // These values should be numbers, so ensure that they really are numbers. + $value = (int)$value; + } elseif (is_array($value)) { + // Ignoring arrays. + } elseif ($key != 'html') { + // Avoid being able to inject some ugly stuff through these fields. + $value = htmlentities($value); + } else { + /// @todo Add a way to sanitize the html as well, possibly with an