From 9e3e1d3d5632b2f4690018677e2ba82beb399fca Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 19 Mar 2010 10:15:00 -0700 Subject: [PATCH] Validate OStatus avatar URL before fetching. --- plugins/OStatus/classes/Ostatus_profile.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index e77c8f7e92..e0e0223b8f 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -839,8 +839,8 @@ class Ostatus_profile extends Memcached_DataObject } /** - * * Download and update given avatar image + * * @param string $url * @throws Exception in various failure cases */ @@ -850,6 +850,9 @@ class Ostatus_profile extends Memcached_DataObject // We've already got this one. return; } + if (!common_valid_http_url($url)) { + throw new ServerException(_m("Invalid avatar URL %s"), $url); + } if ($this->isGroup()) { $self = $this->localGroup();