From: Chris W. <la...@us...> - 2004-10-04 04:06:44
|
Update of /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23932/lib/OpenInteract2 Modified Files: URL.pm Log Message: OIN-79: update OI2::URL to escape the given base URL as well as the query arguments; update tests to check Index: URL.pm =================================================================== RCS file: /cvsroot/openinteract/OpenInteract2/lib/OpenInteract2/URL.pm,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** URL.pm 2 Oct 2004 22:24:15 -0000 1.23 --- URL.pm 4 Oct 2004 04:06:22 -0000 1.24 *************** *** 85,89 **** $log->is_debug && $log->debug( "Creating image URL from '$url_base' ", ! "and params [$param_info]" ); return $class->create_image( $url_base, $params ); } --- 85,89 ---- $log->is_debug && $log->debug( "Creating image URL from '$url_base' ", ! "and params '$param_info'" ); return $class->create_image( $url_base, $params ); } *************** *** 92,101 **** $log->is_debug && $log->debug( "Creating static URL from '$url_base' ", ! "and params [$param_info]" ); return $class->create_image( $url_base, $params ); } $log->is_debug && $log->debug( "Creating deployment URL from '$url_base' ", ! "and params [$param_info]" ); return $class->_create_deployment( DEPLOY_URL, $url_base, $params ); } --- 92,101 ---- $log->is_debug && $log->debug( "Creating static URL from '$url_base' ", ! "and params '$param_info'" ); return $class->create_image( $url_base, $params ); } $log->is_debug && $log->debug( "Creating deployment URL from '$url_base' ", ! "and params '$param_info'" ); return $class->_create_deployment( DEPLOY_URL, $url_base, $params ); } *************** *** 118,121 **** --- 118,122 ---- sub _create_deployment { my ( $class, $deploy_under, $url_base, $params ) = @_; + $url_base = _url_escape( $url_base ); if ( $deploy_under ) { $url_base = join( '', $deploy_under, $url_base ); *************** *** 153,157 **** # ...if a URL for the action isn't found unless ( $info->{url_primary} ) { ! $log->warn( "Request URL for action [$action] but ", "primary URL was not found in action info; ", "probably means it's not URL-accessible" ); --- 154,158 ---- # ...if a URL for the action isn't found unless ( $info->{url_primary} ) { ! $log->warn( "Request URL for action '$action' but ", "primary URL was not found in action info; ", "probably means it's not URL-accessible" ); *************** *** 170,174 **** my ( $to_encode ) = shift; return undef unless defined( $to_encode ); ! $to_encode =~ s/([^a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg; return $to_encode; } --- 171,176 ---- my ( $to_encode ) = shift; return undef unless defined( $to_encode ); ! $to_encode =~ s/([^a-zA-Z0-9_~\.\-\*\'\(\)\/\s])/uc sprintf("%%%02x",ord($1))/eg; ! $to_encode =~ s/\s/%20/g; return $to_encode; } *************** *** 200,204 **** to see under what context the application is deployed. Many times this ! will be empty, which means the application sits at the root. =head1 METHODS --- 202,208 ---- to see under what context the application is deployed. Many times this ! will be empty, which means the application sits at the root. This ! value may also set by the L<OpenInteract2::Context> method ! C<assign_deploy_url()>. =head1 METHODS *************** *** 319,323 **** If no C<\%params> are specified then the resulting URL will B<not> have a trailing '?' to indicate the start of a query string. This is ! important to note if you're doing further manipulation of the URL, such as you with if you were embedding it in generated Javascript. --- 323,327 ---- If no C<\%params> are specified then the resulting URL will B<not> have a trailing '?' to indicate the start of a query string. This is ! important to note if you are doing further manipulation of the URL, such as you with if you were embedding it in generated Javascript. *************** *** 370,374 **** If no C<\%params> are specified then the resulting URL will B<not> have a trailing '?' to indicate the start of a query string. This is ! important to note if you're doing further manipulation of the URL, such as you with if you were embedding it in generated Javascript. --- 374,378 ---- If no C<\%params> are specified then the resulting URL will B<not> have a trailing '?' to indicate the start of a query string. This is ! important to note if you are doing further manipulation of the URL, such as you with if you were embedding it in generated Javascript. *************** *** 404,408 **** If no C<\%params> are specified then the resulting URL will B<not> have a trailing '?' to indicate the start of a query string. This is ! important to note if you're doing further manipulation of the URL, such as you with if you were embedding it in generated Javascript. --- 408,412 ---- If no C<\%params> are specified then the resulting URL will B<not> have a trailing '?' to indicate the start of a query string. This is ! important to note if you are doing further manipulation of the URL, such as you with if you were embedding it in generated Javascript. *************** *** 484,488 **** $url = OpenInteract2::URL->create_from_action( 'foo', 'detail', { name => 'Mario Lemieux' } ); ! # $url = '/cgi-bin/oi.cgi/Public/Foo/detail/?name=Mario%20Lemiux' =head1 SEE ALSO --- 488,492 ---- $url = OpenInteract2::URL->create_from_action( 'foo', 'detail', { name => 'Mario Lemieux' } ); ! # $url = '/cgi-bin/oi.cgi/Public/Foo/detail/?name=Mario%20Lemieux' =head1 SEE ALSO |