diff options
author | zotlabs <mike@macgirvin.com> | 2018-03-29 02:26:25 -0700 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-03-29 02:26:25 -0700 |
commit | 33bb89729cdb7d8cc462253fd2b984e2e2bf4471 (patch) | |
tree | bb0268bb6117e64ab4462f37d5b62d16043714b3 /include | |
parent | cd485b0fdf159ed30b73d7bf84d132ab3af9a418 (diff) | |
download | volse-hubzilla-33bb89729cdb7d8cc462253fd2b984e2e2bf4471.tar.gz volse-hubzilla-33bb89729cdb7d8cc462253fd2b984e2e2bf4471.tar.bz2 volse-hubzilla-33bb89729cdb7d8cc462253fd2b984e2e2bf4471.zip |
hubzilla issue #1019 - punycode urls on connedit page when displaying locations
Diffstat (limited to 'include')
-rw-r--r-- | include/hubloc.php | 3 | ||||
-rw-r--r-- | include/text.php | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/include/hubloc.php b/include/hubloc.php index 0d1a2e560..33d5dcbb2 100644 --- a/include/hubloc.php +++ b/include/hubloc.php @@ -270,7 +270,8 @@ function locations_by_netid($netid) { dbesc($netid) ); - return array_elm_to_str($locs,'location',', '); + + return array_elm_to_str($locs,'location',', ','trim_and_unpunify'); } diff --git a/include/text.php b/include/text.php index f9cefd020..f634f0d55 100644 --- a/include/text.php +++ b/include/text.php @@ -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)); +} /** |