cvs commit: modperl-2.0/xs/maps apache_functions.map
dougm 02/05/24 09:58:10 Modified:xs/maps apache_functions.map Log: rename Apache::Util::os_escape_path to Apache::Util::escape_path and reorder args path, p, partial, defaulting partial=TRUE Revision ChangesPath 1.53 +1 -1 modperl-2.0/xs/maps/apache_functions.map Index: apache_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- apache_functions.map 19 May 2002 23:59:52 - 1.52 +++ apache_functions.map 24 May 2002 16:58:10 - 1.53 -280,7 +280,7 !ap_rfc1413 ap_escape_html #escape_uri - ap_os_escape_path + ap_os_escape_path | | path, p, partial=TRUE | escape_path !ap_explode_recent_gmt !ap_explode_recent_localtime !ap_recent_ctime
cvs commit: modperl-2.0/t/response/TestApache compat2.pm
dougm 02/05/24 09:58:42 Modified:lib/Apache compat.pm t/response/TestApache compat2.pm Log: add Apache::Util::escape_uri compat function and tests Revision ChangesPath 1.50 +7 -0 modperl-2.0/lib/Apache/compat.pm Index: compat.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- compat.pm 24 May 2002 16:49:29 - 1.49 +++ compat.pm 24 May 2002 16:58:41 - 1.50 -26,6 +26,7 use Apache::RequestIO (); use Apache::RequestUtil (); use Apache::Response (); +use Apache::Util (); use Apache::Log (); use Apache::URI (); use APR::Table (); -414,6 +415,12 } *unescape_uri = \Apache::unescape_url; + +sub escape_uri { +my $path = shift; +my $r = Apache::compat::request('Apache::Util::escape_uri'); +Apache::Util::escape_path($path, $r-pool); +} sub Apache::URI::parse { my($class, $r, $uri) = _; 1.8 +9 -2 modperl-2.0/t/response/TestApache/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat2.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- compat2.pm19 May 2002 11:41:53 - 1.7 +++ compat2.pm24 May 2002 16:58:42 - 1.8 -24,7 +24,7 sub handler { my $r = shift; -plan $r, tests = 39; +plan $r, tests = 41; $r-send_http_header('text/plain'); -192,8 +192,15 } } -my $uri = http://foo.com/a%20file.html;; +my $uri = http://foo.com/a file.html; +(my $esc_uri = $uri) =~ s/ /\%20/g; my $uri2 = $uri; + +$uri = Apache::Util::escape_uri($uri); +$uri2 = Apache::Util::escape_path($uri2, $r-pool); + +ok t_cmp($esc_uri, $uri, Apache::Util::escape_uri); +ok t_cmp($esc_uri, $uri2, Apache::Util::escape_path); ok t_cmp(Apache::unescape_url($uri), Apache::Util::unescape_uri($uri2),
cvs commit: modperl-2.0/xs/maps apache_functions.map
dougm 02/05/24 10:37:08 Modified:lib/Apache compat.pm t/response/TestApache compat2.pm xs/maps apache_functions.map Log: rename ht_time to format_time for the moment to provide 1.x ht_time compat since we now require a pool Revision ChangesPath 1.52 +12 -0 modperl-2.0/lib/Apache/compat.pm Index: compat.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- compat.pm 24 May 2002 17:19:09 - 1.51 +++ compat.pm 24 May 2002 17:37:08 - 1.52 -440,6 +440,18 $html; } +sub ht_time { +my($t, $fmt, $gmt) = _; + +$t ||= time; +$fmt ||= '%a, %d %b %Y %H:%M:%S %Z'; +$gmt = 1 unless _ == 3; + +my $r = Apache::compat::request('Apache::Util::ht_time'); + +return Apache::Util::format_time($t, $fmt, $gmt, $r-pool); +} + sub Apache::URI::parse { my($class, $r, $uri) = _; 1.10 +6 -1 modperl-2.0/t/response/TestApache/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat2.pm,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- compat2.pm24 May 2002 17:19:09 - 1.9 +++ compat2.pm24 May 2002 17:37:08 - 1.10 -24,7 +24,7 sub handler { my $r = shift; -plan $r, tests = 42; +plan $r, tests = 43; $r-send_http_header('text/plain'); -215,6 +215,11 ok t_cmp($esc_html, Apache::Util::escape_html($html), Apache::Util::escape_html); + + +my $fmtdate = Apache::Util::ht_time(); + +ok t_cmp($fmtdate, $fmtdate, Apache::Util::ht_time); OK; } 1.55 +1 -1 modperl-2.0/xs/maps/apache_functions.map Index: apache_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v retrieving revision 1.54 retrieving revision 1.55 diff -u -r1.54 -r1.55 --- apache_functions.map 24 May 2002 17:19:09 - 1.54 +++ apache_functions.map 24 May 2002 17:37:08 - 1.55 -276,7 +276,7 -ap_set_deprecated MODULE=Apache::Util - ap_ht_time + ap_ht_time | | t, fmt, gmt, p | format_time !ap_rfc1413 !ap_escape_html | | s, p #escape_uri
cvs commit: modperl-2.0/t/response/TestAPR util.pm
dougm 02/05/24 11:08:21 Modified:t/response/TestAPR util.pm Log: adjust APR::password_validate test Revision ChangesPath 1.6 +4 -3 modperl-2.0/t/response/TestAPR/util.pm Index: util.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/util.pm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- util.pm 20 May 2002 22:27:17 - 1.5 +++ util.pm 24 May 2002 18:08:21 - 1.6 -9,6 +9,7 use APR::Util (); use Apache::Const -compile = 'OK'; +use APR::Const -compile = 'EMISMATCH'; sub handler { my $r = shift; -20,11 +21,11 #my $bytes = APR::generate_random_bytes($blen); #ok length($bytes) == $blen; -my $status = APR::password_validate(one, two); +ok ! APR::password_validate(one, two); -ok $status != 0; +my $status = APR::EMISMATCH; -my $str= APR::strerror($status); +my $str = APR::strerror($status); t_debug strerror=$str\n;