aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2018-03-31 13:41:29 -0400
committerAndrew Manning <tamanning@zoho.com>2018-03-31 13:41:29 -0400
commit6decffb00c00fabcb4ef581084eaca038e340686 (patch)
tree34471f015e0b33007ad40059dfdd09c83a768fbb /include/text.php
parent1dc795722a8e748ebb98e8fab778cd4686a0654f (diff)
parent6433ce70a19be8c57edbc72f8df3a4c7ef52f389 (diff)
downloadvolse-hubzilla-6decffb00c00fabcb4ef581084eaca038e340686.tar.gz
volse-hubzilla-6decffb00c00fabcb4ef581084eaca038e340686.tar.bz2
volse-hubzilla-6decffb00c00fabcb4ef581084eaca038e340686.zip
Merge branch 'dev' into oauth2
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/text.php b/include/text.php
index c1e064857..f634f0d55 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1491,7 +1491,7 @@ function format_hashtags(&$item) {
$term = htmlspecialchars($t['term'], ENT_COMPAT, 'UTF-8', false) ;
if(! trim($term))
continue;
- if(strpos($item['body'], $t['url']))
+ if($t['url'] && strpos($item['body'], $t['url']))
continue;
if($s)
$s .= ' ';
@@ -2189,13 +2189,13 @@ function ids_to_querystr($arr,$idx = 'id',$quote = false) {
* @returns string
*/
-function array_elm_to_str($arr,$elm,$delim = ',') {
+function array_elm_to_str($arr,$elm,$delim = ',',$each = 'trim') {
$tmp = [];
if($arr && is_array($arr)) {
foreach($arr as $x) {
if(is_array($x) && array_key_exists($elm,$x)) {
- $z = trim($x[$elm]);
+ $z = $each($x[$elm]);
if(($z) && (! in_array($z,$tmp))) {
$tmp[] = $z;
}
@@ -2205,7 +2205,9 @@ function array_elm_to_str($arr,$elm,$delim = ',') {
return implode($delim,$tmp);
}
-
+function trim_and_unpunify($s) {
+ return unpunify(trim($s));
+}
/**