]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #5421 fixes some encoding issues where wrong context was used
authorcash <cash.costello@gmail.com>
Fri, 3 May 2013 00:40:50 +0000 (20:40 -0400)
committercash <cash.costello@gmail.com>
Fri, 3 May 2013 00:40:50 +0000 (20:40 -0400)
views/default/output/tag.php
views/default/output/tags.php

index 3e1f1c32088fc1d31b832b21238386613a5cb586..6bd9a72a78dd3b4ba98c63512971a717c2b62f13 100644 (file)
@@ -8,25 +8,25 @@
  *
  */
 
+if (!empty($vars['type'])) {
+       $type = "&type=" . rawurlencode($vars['type']);
+} else {
+       $type = "";
+}
 if (!empty($vars['subtype'])) {
-       $subtype = "&subtype=" . urlencode($vars['subtype']);
+       $subtype = "&subtype=" . rawurlencode($vars['subtype']);
 } else {
        $subtype = "";
 }
 if (!empty($vars['object'])) {
-       $object = "&object=" . urlencode($vars['object']);
+       $object = "&object=" . rawurlencode($vars['object']);
 } else {
        $object = "";
 }
 
 if (isset($vars['value'])) {
+       $url = elgg_get_site_url() . 'search?q=' . rawurlencode($vars['value']) . "&search_type=tags{$type}{$subtype}{$object}";
        $vars['value'] = htmlspecialchars($vars['value'], ENT_QUOTES, 'UTF-8', false);
-       if (!empty($vars['type'])) {
-               $type = "&type={$vars['type']}";
-       } else {
-               $type = "";
-       }
-       $url = elgg_get_site_url() . 'search?q=' . urlencode($vars['value']) . "&search_type=tags{$type}{$subtype}{$object}";
        echo elgg_view('output/url', array(
                'href' => $url,
                'text' => $vars['value'],
index 41fd5f168093b1abee04c6b89ba3f065b9139c47..db096a3bedeff89789ac1ea26ea9ae9e7f9d9501 100644 (file)
@@ -17,13 +17,18 @@ if (isset($vars['entity'])) {
        unset($vars['entity']);
 }
 
+if (!empty($vars['type'])) {
+       $type = "&type=" . rawurlencode($vars['type']);
+} else {
+       $type = "";
+}
 if (!empty($vars['subtype'])) {
-       $subtype = "&subtype=" . urlencode($vars['subtype']);
+       $subtype = "&subtype=" . rawurlencode($vars['subtype']);
 } else {
        $subtype = "";
 }
 if (!empty($vars['object'])) {
-       $object = "&object=" . urlencode($vars['object']);
+       $object = "&object=" . rawurlencode($vars['object']);
 } else {
        $object = "";
 }
@@ -53,16 +58,11 @@ if (!empty($vars['tags'])) {
 
        $icon_class = elgg_extract('icon_class', $vars);
        $list_items = '<li>' . elgg_view_icon('tag', $icon_class) . '</li>';
-
+               
        foreach($vars['tags'] as $tag) {
-               $tag = htmlspecialchars($tag, ENT_QUOTES, 'UTF-8', false);
-               if (!empty($vars['type'])) {
-                       $type = "&type={$vars['type']}";
-               } else {
-                       $type = "";
-               }
-               $url = elgg_get_site_url() . 'search?q=' . urlencode($tag) . "&search_type=tags{$type}{$subtype}{$object}";
+               $url = elgg_get_site_url() . 'search?q=' . rawurlencode($tag) . "&search_type=tags{$type}{$subtype}{$object}";
                if (is_string($tag)) {
+                       $tag = htmlspecialchars($tag, ENT_QUOTES, 'UTF-8', false);
                        $list_items .= "<li class=\"$item_class\">";
                        $list_items .= elgg_view('output/url', array('href' => $url, 'text' => $tag, 'rel' => 'tag'));
                        $list_items .= '</li>';