aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2017-10-28 01:22:59 +0200
committerKlaus Weidenbach <Klaus.Weidenbach@gmx.net>2017-10-29 22:00:55 +0100
commit1be98d7b7fea30a929d27e7aa0b1412da3276b2c (patch)
tree7d7d5bbfbed65f89e6232235bf4b5534fe0fa03f /include
parent66832c41e9fff481c20ca219b3cc0a4e53b8b551 (diff)
downloadvolse-hubzilla-1be98d7b7fea30a929d27e7aa0b1412da3276b2c.tar.gz
volse-hubzilla-1be98d7b7fea30a929d27e7aa0b1412da3276b2c.tar.bz2
volse-hubzilla-1be98d7b7fea30a929d27e7aa0b1412da3276b2c.zip
:white_check_mark: Some more work on unit tests.
Some small improvements for coverage report. Add more functions from include/text.php Update composer dev libraries for phpunit.
Diffstat (limited to 'include')
-rw-r--r--include/feedutils.php30
1 files changed, 21 insertions, 9 deletions
diff --git a/include/feedutils.php b/include/feedutils.php
index 217da8188..62fa4849a 100644
--- a/include/feedutils.php
+++ b/include/feedutils.php
@@ -1662,8 +1662,6 @@ function handle_feed($uid, $abook_id, $url) {
/**
* @brief Return a XML tag with author information.
*
- * @hooks \b atom_author Possibility to add further tags to returned XML string
- * * \e string The created XML tag as a string without closing tag
* @param string $tag The XML tag to create
* @param string $nick preferred username
* @param string $name displayed name of the author
@@ -1672,7 +1670,7 @@ function handle_feed($uid, $abook_id, $url) {
* @param int $w image width
* @param string $type profile photo mime type
* @param string $photo Fully qualified URL to a profile/avator photo
- * @return string
+ * @return string XML tag
*/
function atom_author($tag, $nick, $name, $uri, $h, $w, $type, $photo) {
$o = '';
@@ -1695,6 +1693,11 @@ function atom_author($tag, $nick, $name, $uri, $h, $w, $type, $photo) {
$o .= ' <poco:preferredUsername>' . $nick . '</poco:preferredUsername>' . "\r\n";
$o .= ' <poco:displayName>' . $name . '</poco:displayName>' . "\r\n";
+ /**
+ * @hooks atom_author
+ * Possibility to add further tags to returned XML string.
+ * * \e string The created XML tag as a string without closing tag
+ */
call_hooks('atom_author', $o);
$o .= "</$tag>\r\n";
@@ -1703,17 +1706,23 @@ function atom_author($tag, $nick, $name, $uri, $h, $w, $type, $photo) {
}
-function atom_render_author($tag,$xchan) {
+/**
+ * @brief Return an atom tag with author information from an xchan.
+ *
+ * @param string $tag
+ * @param array $xchan
+ * @return string
+ */
+function atom_render_author($tag, $xchan) {
-
- $nick = xmlify(substr($xchan['xchan_addr'],0,strpos($xchan['xchan_addr'],'@')));
+ $nick = xmlify(substr($xchan['xchan_addr'], 0, strpos($xchan['xchan_addr'], '@')));
$id = xmlify($xchan['xchan_url']);
$name = xmlify($xchan['xchan_name']);
$photo = xmlify($xchan['xchan_photo_l']);
$type = xmlify($xchan['xchan_photo_mimetype']);
$w = $h = 300;
- $o .= "<$tag>\r\n";
+ $o = "<$tag>\r\n";
$o .= " <as:object-type>http://activitystrea.ms/schema/1.0/person</as:object-type>\r\n";
$o .= " <id>$id</id>\r\n";
$o .= " <name>$nick</name>\r\n";
@@ -1724,13 +1733,16 @@ function atom_render_author($tag,$xchan) {
$o .= ' <poco:preferredUsername>' . $nick . '</poco:preferredUsername>' . "\r\n";
$o .= ' <poco:displayName>' . $name . '</poco:displayName>' . "\r\n";
+ /**
+ * @hooks atom_render_author
+ * Possibility to add further tags to returned XML string.
+ * * \e string The created XML tag as a string without closing tag
+ */
call_hooks('atom_render_author', $o);
$o .= "</$tag>\r\n";
return $o;
-
-
}
function compat_photos_list($s) {