summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorZach Copley <zach@status.net>2010-02-24 16:52:16 -0800
committerZach Copley <zach@status.net>2010-02-24 16:52:16 -0800
commit10884dcd49da8db1fcca3cbbef0f85869d43520e (patch)
tree7c8376ed6cea7c971faacaa6e223a670d0e6481f /lib
parent543ff40ef62f2587cde084b03bcf2e956f52ce2f (diff)
parent5173d92895e892412e8a8c10b4e434c924593c99 (diff)
Merge branch 'testing' of gitorious.org:statusnet/mainline into testing
* 'testing' of gitorious.org:statusnet/mainline: Merge StatusNet core localization updates from 0.9.x branch Fix update_po_templates.php to support the plural and context variants of _m() in plugins Drop HTMLPurifier; we don't need its extra capabilities and we're already using htmLawed which is lighter-weight. OStatus: handle update-profile Salmon pings Revert "Updated jQuery Form Plugin from v2.17 to v2.36" OStatus: disable HTMLPurify cache unless we've configured a writable path for it.
Diffstat (limited to 'lib')
-rw-r--r--lib/activity.php26
1 files changed, 14 insertions, 12 deletions
diff --git a/lib/activity.php b/lib/activity.php
index eace672a5..3de5f62c7 100644
--- a/lib/activity.php
+++ b/lib/activity.php
@@ -175,16 +175,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;
@@ -309,7 +311,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);
@@ -337,7 +339,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) {
@@ -362,7 +364,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);