You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a Picture tries to download an image sent as a plain link in a chat message, it gets a garbled URL that has its & characters replaced with &, leading to download failure and broken_image_filled being displayed instead of the linked image.
I haven't looked deep enough to know whether this fix is reasonable, but it does make things work:
diff --git a/app/widgets/Picture/Picture.php b/app/widgets/Picture/Picture.php
index 71047419c..512046389 100644
--- a/app/widgets/Picture/Picture.php+++ b/app/widgets/Picture/Picture.php@@ -10,7 +10,7 @@ class Picture extends Base
public function display()
{
- $url = urldecode($this->get('url'));+ $url = html_entity_decode(urldecode($this->get('url')));
$parsedUrl = parse_url($url);
if (
is_array($parsedUrl)
@@ -27,7 +27,7 @@ class Picture extends Base
$max = $headers["download_content_length"] > $this->compressLimit ? $this->compressLimit : $headers["download_content_length"];
$ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $this->get('url'));+ curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
The text was updated successfully, but these errors were encountered:
When a
Picture
tries to download an image sent as a plain link in a chat message, it gets a garbled URL that has its&
characters replaced with&
, leading to download failure andbroken_image_filled
being displayed instead of the linked image.I haven't looked deep enough to know whether this fix is reasonable, but it does make things work:
The text was updated successfully, but these errors were encountered: