Browse Source

null-check for $url before checking for key

Comes up for Known which gives funky syndication-target IDs like twitter::kylewmahan.
pull/30/head
Kyle Mahan 9 years ago
parent
commit
8154db31d3
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      lib/helpers.php

+ 2
- 2
lib/helpers.php View File

@ -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 // 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 // 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( $targets[] = array(
'target' => $t, 'target' => $t,
'favicon' => 'http://' . $url['host'] . '/favicon.ico' 'favicon' => 'http://' . $url['host'] . '/favicon.ico'
@ -313,4 +313,4 @@ function validate_photo(&$file) {
return $e->getMessage(); return $e->getMessage();
} }
}
}

Loading…
Cancel
Save