aboutsummaryrefslogtreecommitdiffstats
path: root/include/text.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-03-31 15:25:17 -0700
committerfriendica <info@friendica.com>2012-03-31 15:25:17 -0700
commit53f799f2bc125fadf527e3c65e8e9882d53d9aea (patch)
tree62114f520a5aae5eebfc5331617aa0e17ae1942f /include/text.php
parent7581b32bb38fe4e0f9703cc887a54984ebfe88ea (diff)
downloadvolse-hubzilla-53f799f2bc125fadf527e3c65e8e9882d53d9aea.tar.gz
volse-hubzilla-53f799f2bc125fadf527e3c65e8e9882d53d9aea.tar.bz2
volse-hubzilla-53f799f2bc125fadf527e3c65e8e9882d53d9aea.zip
handle escaped file chars in display and search
Diffstat (limited to 'include/text.php')
-rw-r--r--include/text.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/text.php b/include/text.php
index 64f6f72a8..191f4fca8 100644
--- a/include/text.php
+++ b/include/text.php
@@ -920,7 +920,7 @@ function prepare_body($item,$attach = false) {
foreach($matches as $mtch) {
if(strlen($x))
$x .= ',';
- $x .= file_tag_decode($mtch[1]);
+ $x .= xmlify(file_tag_decode($mtch[1]));
}
if(strlen($x))
$s .= '<div class="categorytags"><span>' . t('Categories:') . ' </span>' . $x . '</div>';
@@ -935,7 +935,7 @@ function prepare_body($item,$attach = false) {
foreach($matches as $mtch) {
if(strlen($x))
$x .= '&nbsp;&nbsp;&nbsp;';
- $x .= file_tag_decode($mtch[1]). ' <a href="' . $a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&term=' . file_tag_decode($mtch[1]) . '" title="' . t('remove') . '" >' . t('[remove]') . '</a>';
+ $x .= xmlify(file_tag_decode($mtch[1])) . ' <a href="' . $a->get_baseurl() . '/filerm/' . $item['id'] . '?f=&term=' . xmlify(file_tag_decode($mtch[1])) . '" title="' . t('remove') . '" >' . t('[remove]') . '</a>';
}
if(strlen($x) && (local_user() == $item['uid']))
$s .= '<div class="filesavetags"><span>' . t('Filed under:') . ' </span>' . $x . '</div>';
@@ -1307,13 +1307,10 @@ function file_tag_decode($s) {
function file_tag_file_query($table,$s,$type = 'file') {
- // this is ultimately going into a vsprintf
- $s = str_replace('%','%%',$s);
-
if($type == 'file')
- $str = preg_quote( '[' . file_tag_encode($s) . ']' );
+ $str = preg_quote( '[' . str_replace('%','%%',file_tag_encode($s)) . ']' );
else
- $str = preg_quote( '<' . file_tag_encode($s) . '>' );
+ $str = preg_quote( '<' . str_replace('%','%%',file_tag_encode($s)) . '>' );
return " AND " . (($table) ? dbesc($table) . '.' : '') . "file regexp '" . dbesc($str) . "' ";
}