[Rt-commit] [svn] r898 - in RTx-Atom: . html/Atom/0.3 html/Atom/0.3/Search lib/RT

autrijus at pallas.eruditorum.org autrijus at pallas.eruditorum.org
Fri May 14 14:24:29 EDT 2004


Author: autrijus
Date: Fri May 14 14:24:29 2004
New Revision: 898

Modified:
   RTx-Atom/   (props changed)
   RTx-Atom/html/Atom/0.3/Search/index
   RTx-Atom/html/Atom/0.3/dhandler
   RTx-Atom/lib/RT/Atom.pm
Log:
 ----------------------------------------------------------------------
 r4888 at not:  autrijus | 2004-05-14T18:24:13.047195Z
 
 * Switch from using Elements/QueryString to URI->query_form.
 ----------------------------------------------------------------------


Modified: RTx-Atom/html/Atom/0.3/Search/index
==============================================================================
--- RTx-Atom/html/Atom/0.3/Search/index	(original)
+++ RTx-Atom/html/Atom/0.3/Search/index	Fri May 14 14:24:29 2004
@@ -31,10 +31,10 @@
 % }
   <info></info>
 % if ($page > 1) {
-  <& $ShowLink, URI => "$FeedURI?$prev", Title => "Previous Page", Relation => 'prev', &>
+  <& $ShowLink, URI => $prev->as_string, Title => "Previous Page", Relation => 'prev', &>
 % }
 % if (($page * $rows) < $TotalFound) {
-  <& $ShowLink, URI => "$FeedURI?$next", Title => "Next Page", Relation => 'next', &>
+  <& $ShowLink, URI => $next->as_string, Title => "Next Page", Relation => 'next', &>
 % }
 </feed>
 <%INIT>
@@ -62,10 +62,12 @@
 
 my %query;
 while (my ($k, $v) = each %ARGS) {
-    $query{$k} = $v if $k eq lc($k);
+    $query{$k} = $v if $k eq lc($k) and $k ne 'page';
 }
-my $prev = $m->comp('/Elements/QueryString', %query, page => ($page-1));
-my $next = $m->comp('/Elements/QueryString', %query, page => ($page+1));
+my $prev = URI->new($FeedURI);
+$prev->query_form( %query, page => ($page-1) );
+my $next = URI->new($FeedURI);
+$next->query_form( %query, page => ($page+1) );
 
 </%INIT>
 <%ARGS>

Modified: RTx-Atom/html/Atom/0.3/dhandler
==============================================================================
--- RTx-Atom/html/Atom/0.3/dhandler	(original)
+++ RTx-Atom/html/Atom/0.3/dhandler	Fri May 14 14:24:29 2004
@@ -242,10 +242,10 @@
 
 	# Redirect "safe" methods.
 	$path = join('/', $type, @parts);
-	my $query = $m->comp('/Elements/QueryString', $m->request_args);
-	$query = "?$query" if length $query;
 	$path .= "!$user_method" if $user_method;
-	$r->header_out(Location => "$BaseURI/$path$query");
+	my $uri = URI->new("$BaseURI/$path");
+	$uri->query_form( $m->request_args );
+	$r->header_out(Location => $uri->as_string);
 	return $m->comp('Elements/Error', Status => 301);
     }
 }

Modified: RTx-Atom/lib/RT/Atom.pm
==============================================================================
--- RTx-Atom/lib/RT/Atom.pm	(original)
+++ RTx-Atom/lib/RT/Atom.pm	Fri May 14 14:24:29 2004
@@ -3,6 +3,7 @@
 
 use strict;
 
+use URI;
 use XML::Simple;
 use Digest::MD5;
 use Digest::SHA1;


More information about the Rt-commit mailing list