[freeside-commits] freeside/rt/lib/RT/Interface Web.pm,1.7,1.8
Ivan,,,
ivan at wavetail.420.am
Mon Apr 18 16:49:56 PDT 2011
- Previous message: [freeside-commits] freeside/rt/lib/RT Action.pm, 1.3, 1.4 Condition.pm, 1.3, 1.4 Config.pm, 1.8, 1.9 CustomField.pm, 1.3, 1.4 Date.pm, 1.5, 1.6 Principal_Overlay.pm, 1.3, 1.4 Record.pm, 1.10, 1.11 SearchBuilder.pm, 1.9, 1.10 System.pm, 1.3, 1.4 Test.pm, 1.3, 1.4 Ticket_Overlay.pm, 1.19, 1.20 Tickets_Overlay.pm, 1.13, 1.14 User_Overlay.pm, 1.7, 1.8 Users_Overlay.pm, 1.6, 1.7
- Next message: [freeside-commits] freeside/rt/lib/RT/Search Googleish.pm,1.2,1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/rt/lib/RT/Interface
In directory wavetail.420.am:/tmp/cvs-serv2120/lib/RT/Interface
Modified Files:
Web.pm
Log Message:
commiting rt 3.8.10 to HEAD
Index: Web.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/lib/RT/Interface/Web.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -d -r1.7 -r1.8
--- Web.pm 8 Mar 2011 02:57:24 -0000 1.7
+++ Web.pm 18 Apr 2011 23:49:54 -0000 1.8
@@ -195,6 +195,8 @@
# Process session-related callbacks before any auth attempts
$HTML::Mason::Commands::m->callback( %$ARGS, CallbackName => 'Session', CallbackPage => '/autohandler' );
+ MaybeRejectPrivateComponentRequest();
+
MaybeShowNoAuthPage($ARGS);
AttemptExternalAuth($ARGS) if RT->Config->Get('WebExternalAuthContinuous') or not _UserLoggedIn();
@@ -412,6 +414,37 @@
$m->abort;
}
+=head2 MaybeRejectPrivateComponentRequest
+
+This function will reject calls to private components, like those under
+C</Elements>. If the requested path is a private component then we will
+abort with a C<403> error.
+
+=cut
+
+sub MaybeRejectPrivateComponentRequest {
+ my $m = $HTML::Mason::Commands::m;
+ my $path = $m->request_comp->path;
+
+ # We do not check for dhandler here, because requesting our dhandlers
+ # directly is okay. Mason will invoke the dhandler with a dhandler_arg of
+ # 'dhandler'.
+
+ if ($path =~ m{
+ / # leading slash
+ ( Elements |
+ _elements | # mobile UI
+ Widgets |
+ autohandler | # requesting this directly is suspicious
+ l ) # loc component
+ ( $ | / ) # trailing slash or end of path
+ }xi) {
+ $m->abort(403);
+ }
+
+ return;
+}
+
=head2 ShowRequestedPage \%ARGS
This function, called exclusively by RT's autohandler, dispatches
@@ -796,8 +829,15 @@
}
$type ||= "application/octet-stream";
}
+
+ # CGI.pm version 3.51 and 3.52 bang charset=iso-8859-1 onto our JS
+ # since we don't specify a charset
+ if ( $type =~ m{application/javascript} &&
+ $type !~ m{charset=([\w-]+)$} ) {
+ $type .= "; charset=utf-8";
+ }
$HTML::Mason::Commands::r->content_type($type);
- open my $fh, "<$file" or die "couldn't open file: $!";
+ open( my $fh, '<', $file ) or die "couldn't open file: $!";
binmode($fh);
{
local $/ = \16384;
@@ -841,8 +881,13 @@
# Check for plaintext sig
return '' if not $html and $content =~ /^(--)?\Q$sig\E$/;
- # Check for html-formatted sig
- RT::Interface::Web::EscapeUTF8( \$sig );
+ # Check for html-formatted sig; we don't use EscapeUTF8 here
+ # because we want to precisely match the escaping that FCKEditor
+ # uses. see also 311223f5, which fixed this for 4.0
+ $sig =~ s/&/&/g;
+ $sig =~ s/</</g;
+ $sig =~ s/>/>/g;
+
return ''
if $html
and $content =~ m{^(?:<p>)?(--)?\Q$sig\E(?:</p>)?$}s;
@@ -2272,9 +2317,6 @@
return ( _load_container_object( $obj_type, $obj_id ), $search_id );
}
-eval "require RT::Interface::Web_Vendor";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Interface/Web_Vendor.pm} );
-eval "require RT::Interface::Web_Local";
-die $@ if ( $@ && $@ !~ qr{^Can't locate RT/Interface/Web_Local.pm} );
+RT::Base->_ImportOverlays();
1;
- Previous message: [freeside-commits] freeside/rt/lib/RT Action.pm, 1.3, 1.4 Condition.pm, 1.3, 1.4 Config.pm, 1.8, 1.9 CustomField.pm, 1.3, 1.4 Date.pm, 1.5, 1.6 Principal_Overlay.pm, 1.3, 1.4 Record.pm, 1.10, 1.11 SearchBuilder.pm, 1.9, 1.10 System.pm, 1.3, 1.4 Test.pm, 1.3, 1.4 Ticket_Overlay.pm, 1.19, 1.20 Tickets_Overlay.pm, 1.13, 1.14 User_Overlay.pm, 1.7, 1.8 Users_Overlay.pm, 1.6, 1.7
- Next message: [freeside-commits] freeside/rt/lib/RT/Search Googleish.pm,1.2,1.3
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list