Browse Source

Merge pull request #30 from kylewm/patch-1

null-check for $url before checking for key
pull/35/head
Aaron Parecki 8 years ago
parent
commit
c59616a7c4
  1. 4
      lib/helpers.php

4
lib/helpers.php

@ -209,7 +209,7 @@ function get_syndication_targets(&$user) {
// If there's a host, and the host contains a . then we can assume there's a favicon
// parse_url will parse strings like http://twitter into an array with a host of twitter, which is not resolvable
if(array_key_exists('host', $url) && strpos($url['host'], '.') !== false) {
if($url && array_key_exists('host', $url) && strpos($url['host'], '.') !== false) {
$targets[] = array(
'target' => $t,
'favicon' => 'http://' . $url['host'] . '/favicon.ico'
@ -313,4 +313,4 @@ function validate_photo(&$file) {
return $e->getMessage();
}
}
}
Loading…
Cancel
Save