summaryrefslogtreecommitdiff
path: root/classes/feeditem/common.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2016-01-23 01:48:32 +0300
committerAndrew Dolgov <[email protected]>2016-01-23 01:48:32 +0300
commit7d1e15c396f36c261d0c8067fc316f6c3e8e1948 (patch)
tree900a332a2b5ddfef8e3c9075570275fc3ef0d05f /classes/feeditem/common.php
parentd2bb392bae5d3de97e1e99bc810524e149c5c199 (diff)
parser: properly support tag subtrees instead of text content for article content
Diffstat (limited to 'classes/feeditem/common.php')
-rw-r--r--classes/feeditem/common.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/classes/feeditem/common.php b/classes/feeditem/common.php
index 80bebf8fb..070692d7f 100644
--- a/classes/feeditem/common.php
+++ b/classes/feeditem/common.php
@@ -70,6 +70,17 @@ abstract class FeedItem_Common extends FeedItem {
}
}
+ function count_children($node) {
+ return $node->getElementsByTagName("*")->length;
+ }
+
+ function subtree_or_text($node) {
+ if ($this->count_children($node) == 0) {
+ return $node->nodeValue;
+ } else {
+ return $node->c14n();
+ }
+ }
}
?>