Commit 05870f63165e5099db547b0449f560e602dcf399

Authored by kevin_fourie
1 parent 38257b13

Merged in from STABLE trunk...

KTS-3721
"When attempting to access the tag from the Dashboard Tag Cloud dashlet"
Fixed. The url needed to be encoded.

KTS-3720
"When using the following characters as a tag '´`&;!.~$()#=[]^@-_{}°º©ºª♪¿⌐¬½¼¾±¡♂£¥₧ «» the document does not show when the tag is navigated and the system incorrectly reports that 2 additional tags were created for the document."
Fixed. The tag in redirect url is now encoded and decoded.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/branches/3.5.3a-Release-Branch@9361 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/util/ktutil.inc
@@ -1272,8 +1272,9 @@ class KTUtil { @@ -1272,8 +1272,9 @@ class KTUtil {
1272 { 1272 {
1273 if (file_exists($path)) { 1273 if (file_exists($path)) {
1274 // IE7 adds underscores to filenames: fix 1274 // IE7 adds underscores to filenames: fix
  1275 + // IE6 displays characters incorrectly
1275 $browser = $_SERVER['HTTP_USER_AGENT']; 1276 $browser = $_SERVER['HTTP_USER_AGENT'];
1276 - if ( strpos( strtoupper( $browser), 'MSIE 7') !== false) { 1277 + if ( strpos( strtoupper( $browser), 'MSIE') !== false) {
1277 $fileName = rawurlencode($fileName); 1278 $fileName = rawurlencode($fileName);
1278 } 1279 }
1279 1280
plugins/tagcloud/TagCloudRedirectPage.php
@@ -63,7 +63,7 @@ class TagCloudRedirectPage extends KTStandardDispatcher { @@ -63,7 +63,7 @@ class TagCloudRedirectPage extends KTStandardDispatcher {
63 */ 63 */
64 function do_main() { 64 function do_main() {
65 // Clear the session for a new search 65 // Clear the session for a new search
66 - $url = isset($_REQUEST['tag']) ? 'tag='.$_REQUEST['tag'] : ''; 66 + $url = isset($_REQUEST['tag']) ? 'tag='.urlencode($_REQUEST['tag']).'&decode=true' : '';
67 $_SESSION['tagList'] = array(); 67 $_SESSION['tagList'] = array();
68 $this->redirectTo('search', $url); 68 $this->redirectTo('search', $url);
69 } 69 }
@@ -81,12 +81,17 @@ class TagCloudRedirectPage extends KTStandardDispatcher { @@ -81,12 +81,17 @@ class TagCloudRedirectPage extends KTStandardDispatcher {
81 81
82 $_SESSION['tagList'] = $tagList; 82 $_SESSION['tagList'] = $tagList;
83 83
84 - $this->redirectTo('search', 'tag='.$tag); 84 + $url = 'tag='.urlencode($tag).'&decode=true';
  85 + $this->redirectTo('search', $url);
85 } 86 }
86 87
87 function do_search() { 88 function do_search() {
88 // Get the tag to search for and create search query 89 // Get the tag to search for and create search query
89 $tag = isset($_REQUEST['tag']) ? $_REQUEST['tag'] : ''; 90 $tag = isset($_REQUEST['tag']) ? $_REQUEST['tag'] : '';
  91 + $decode = isset($_REQUEST['decode']) ? $_REQUEST['decode'] : '';
  92 + if($decode == 'true'){
  93 + $tag = urldecode($tag);
  94 + }
90 95
91 $iUserId = $_SESSION['userID']; 96 $iUserId = $_SESSION['userID'];
92 $oUser = User::get($iUserId); 97 $oUser = User::get($iUserId);
@@ -102,7 +107,10 @@ class TagCloudRedirectPage extends KTStandardDispatcher { @@ -102,7 +107,10 @@ class TagCloudRedirectPage extends KTStandardDispatcher {
102 107
103 $base = KTUtil::addQueryString('TagCloudRedirection&action=recall', null); 108 $base = KTUtil::addQueryString('TagCloudRedirection&action=recall', null);
104 foreach($aTagTree as $key => $item){ 109 foreach($aTagTree as $key => $item){
105 - $url = $base.'&tag='.$item.'&pos='.$key; 110 + if($tag == $item){
  111 + continue;
  112 + }
  113 + $url = $base.'&tag='.urlencode($item).'&pos='.$key;
106 $this->aBreadcrumbs[] = array('url' => $url, 'name' => $item); 114 $this->aBreadcrumbs[] = array('url' => $url, 'name' => $item);
107 } 115 }
108 } 116 }
@@ -134,7 +142,7 @@ class TagCloudRedirectPage extends KTStandardDispatcher { @@ -134,7 +142,7 @@ class TagCloudRedirectPage extends KTStandardDispatcher {
134 142
135 $aOptions = $collection->getEnvironOptions(); // extract data from the environment 143 $aOptions = $collection->getEnvironOptions(); // extract data from the environment
136 144
137 - $aOptions['return_url'] = KTUtil::addQueryString('TagCloudRedirection&action=search&tag='. $tag, false ); 145 + $aOptions['return_url'] = KTUtil::addQueryString('TagCloudRedirection&action=search&tag='. urlencode($tag), false );
138 $aOptions['empty_message'] = _kt('No documents or folders match this query.'); 146 $aOptions['empty_message'] = _kt('No documents or folders match this query.');
139 $aOptions['is_browse'] = true; 147 $aOptions['is_browse'] = true;
140 148
plugins/tagcloud/templates/TagCloud/portlet.smarty
@@ -10,20 +10,19 @@ text-decoration: none; @@ -10,20 +10,19 @@ text-decoration: none;
10 </style> 10 </style>
11 {/literal} 11 {/literal}
12 12
13 -{if empty($tags)}  
14 -<p>  
15 - {i18n}There are no tags defined or accessible.{/i18n}  
16 -</p>  
17 -  
18 -{else}  
19 -<div id=tagcloud>  
20 -{foreach from=$tags key=tag item=size}  
21 -  
22 - <a href="{$url}&tag={$tag|urlencode}" style="color: #333; font-size: {$size}px">{$tag|sanitize}</a>&nbsp;  
23 -  
24 -{/foreach} 13 +<div style="padding: 5px;">
  14 + {if empty($tags)}
  15 + <p>
  16 + {i18n}There are no tags defined or accessible.{/i18n}
  17 + </p>
  18 + {else}
  19 + <div id=tagcloud>
  20 + {foreach from=$tags key=tag item=size}
  21 + <a href="{$url}&tag={$tag|urlencode}" style="color: #333; font-size: {$size}px">{$tag|sanitize_input}</a>&nbsp;
  22 + {/foreach}
  23 + </div>
  24 + {/if}
25 </div> 25 </div>
26 -{/if}  
27 26
28 <br> 27 <br>
29 <br> 28 <br>
30 \ No newline at end of file 29 \ No newline at end of file