diff options
author | Brion Vibber <brion@pobox.com> | 2010-02-24 22:16:17 +0000 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-02-24 22:16:17 +0000 |
commit | ec4899e6179f2d9b368e6fc04041dd72c2ac2596 (patch) | |
tree | 2b69013c063cd8153a736f607a66263ebc44b79c /lib/activity.php | |
parent | 01cfe86cd27eb302a69c5d6df8eddc4893b774c3 (diff) |
OStatus: disable HTMLPurify cache unless we've configured a writable path for it.
Updated plugin README with available config options.
Cleanup for a bad element fallback lookup in Activity
Diffstat (limited to 'lib/activity.php')
-rw-r--r-- | lib/activity.php | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/lib/activity.php b/lib/activity.php index 33932ad0e..25727bf2b 100644 --- a/lib/activity.php +++ b/lib/activity.php @@ -167,16 +167,18 @@ class PoCo PoCo::NS ); - $formatted = ActivityUtils::childContent( - $addressEl, - PoCoAddress::FORMATTED, - self::NS - ); + if (!empty($addressEl)) { + $formatted = ActivityUtils::childContent( + $addressEl, + PoCoAddress::FORMATTED, + self::NS + ); - if (!empty($formatted)) { - $address = new PoCoAddress(); - $address->formatted = $formatted; - return $address; + if (!empty($formatted)) { + $address = new PoCoAddress(); + $address->formatted = $formatted; + return $address; + } } return null; @@ -292,7 +294,7 @@ class ActivityUtils * @return string related link, if any */ - static function getLink($element, $rel, $type=null) + static function getLink(DOMNode $element, $rel, $type=null) { $links = $element->getElementsByTagnameNS(self::ATOM, self::LINK); @@ -320,7 +322,7 @@ class ActivityUtils * @return DOMElement found element or null */ - static function child($element, $tag, $namespace=self::ATOM) + static function child(DOMNode $element, $tag, $namespace=self::ATOM) { $els = $element->childNodes; if (empty($els) || $els->length == 0) { @@ -345,7 +347,7 @@ class ActivityUtils * @return string content of the child */ - static function childContent($element, $tag, $namespace=self::ATOM) + static function childContent(DOMNode $element, $tag, $namespace=self::ATOM) { $el = self::child($element, $tag, $namespace); |