[Rt-commit] rt branch, 4.2-trunk, updated. rt-4.2.3-167-g618b21c
Alex Vandiver
alexmv at bestpractical.com
Fri Apr 25 19:35:18 EDT 2014
The branch, 4.2-trunk has been updated
via 618b21cb42a2449fb2c14f0e1218d9e24352a42f (commit)
via f8e77977137143751d98ecba4f79cb96761403f8 (commit)
via 671311f4db2d0e77763849140c4912d9bfd2a855 (commit)
via fa263c4f40def5ab95609eeeefd0439804a61c8d (commit)
via 1f8ee98673ae6fc64a00c648fa10c5c631800f7b (commit)
via 2387a792aa2113a5351914c6dd2319eceb41225c (commit)
via 65ea5558589fa0975d0c258d1c160971a71e9213 (commit)
via 428ce8d95060f64c9cbecd7c0de0c87154bd5ccb (commit)
via bd6f816d47c5b65b0add82291056120112bb0d99 (commit)
via 8edab000b4217470f3394b29f2e5cb459f777a2c (commit)
via f276e7fb3e4ffa7499d6f3777ed02f2719f63fb3 (commit)
via 3ced8bd4a5913cd8241f1ca3a5db212d267beea2 (commit)
via 7e30f73680781683a0e7464ecd0330d98a8ab2bb (commit)
via 2449e5ae007096b6c30839c34912711b690c55f9 (commit)
via b601a70935e0cdc1d64e9b297ca92bd80da3f38f (commit)
via ed61755967a955be56ac22ed6e1967a823b3aaaf (commit)
via ef8ecb32bfae3c9ed15fbc7a48570dde5140ef49 (commit)
via 5ebef047eb784aa923bcf9fcf4750180621754f4 (commit)
via 9582e25ab2a680229e548a16c00cb4ec0fe932be (commit)
via ad921e40bc03b9e2390c2645218409c71bb3b745 (commit)
via 7c6e2af5e2f5292a19fb3d1fe583bbdb2c3ee22f (commit)
via 2898cadebedd3651e99fbdf3910f5fdba91dcf38 (commit)
via a51e3df7654424572923a2149611508e03e386a6 (commit)
via 384d25581965cb0b92bb5fdb5c4f173a2d104f22 (commit)
via ef0630e30f2bbd763f03d162db75a64704d9ed15 (commit)
via b2d7d0187bdd540148c80166942616c7821fd877 (commit)
via a8af3233b302adc021f1fe78de0f7d3fbee8ebb7 (commit)
via 94e22e0ab82bb4a0aff277ea314725f467fed924 (commit)
via c58caefba8e2d787c8682c4aa783f17f8e239b2f (commit)
via 01405be923fc399bd5ac95681bccde71b42e1a25 (commit)
via a46f2e046a6bcd3311c7c6cc6fe8b59182feb709 (commit)
via 2301ca0fae53805d9e85e6a758b24451018d99a9 (commit)
via b3df5322646a4f94b6485869e914a9c96095a5c6 (commit)
via 15edfe9c94b94f2fdac5dbc135dcafdec8b51d4f (commit)
via 2344f09bf7ff246d7e1db5b74a385c203985b96d (commit)
via 27af6e61bdf2b9a0b296ae959adf90bcd32b3d4d (commit)
via 41f9505deb76969de7e63011076bb34b844eb1f7 (commit)
via 8ad1f8611769ff50f99aa90c02b8c1b3c87980bd (commit)
via d3bfd07b1d8812988e68165bdc61ec1fef52a1ab (commit)
via 06ee3fbb1ced5f35cd4a5c3441e9b9bdcd27b146 (commit)
via 1e00a7ab0d94936c71d967f8a22de75a9d9316ba (commit)
via 2d3e94ce9b2a32a274cf7eea94434c2d2b199602 (commit)
via 60dc4b166da34da6d87d956ff1c87cf08d83e412 (commit)
via 326465903cab6aec15bf6c1e7946b568a8d662da (commit)
via 4717d5729e49fe23e8127ef6d7941c5c8ba50c58 (commit)
via 1cdff0b0fe007c98aa76b73cfdd4e1da160d00ac (commit)
via dc4761012f43f4dabd8e5504c00796470808ca33 (commit)
via 0b4868f0c670535d364b7166f8e2607196425a49 (commit)
via 6dc19ce480ed5449e4867e07c44562e30e661e8f (commit)
from c0cad6d3fc3f7edf8219fea701c7ed3f4c4eacae (commit)
Summary of changes:
docs/backups.pod | 2 +-
docs/extending/clickable_links.pod | 9 +
etc/RT_Config.pm.in | 5 +-
etc/upgrade/3.8.9/content | 1 +
lib/RT/Date.pm | 3 +-
lib/RT/Interface/REST.pm | 2 +-
lib/RT/Interface/Web/Handler.pm | 2 +-
lib/RT/Lifecycle.pm | 4 +-
lib/RT/StyleGuide.pod | 199 ++++++----------------
lib/RT/User.pm | 24 ++-
lib/RT/Users.pm | 22 ++-
sbin/rt-setup-fulltext-index.in | 10 +-
sbin/rt-test-dependencies.in | 6 +-
share/html/Elements/CollectionAsTable/ParseFormat | 3 +-
share/html/Elements/MakeClicky | 48 ++----
share/html/Elements/MyRT | 8 +-
share/html/Install/DatabaseDetails.html | 1 +
share/html/Prefs/MyRT.html | 20 +--
share/html/Prefs/Search.html | 15 ++
share/html/Search/Chart | 4 +-
share/html/Search/Chart.html | 2 +-
share/html/Search/Elements/BuildFormatString | 10 +-
share/html/Search/Elements/Chart | 2 +-
share/html/Search/Results.html | 4 +-
t/api/date.t | 8 +
t/api/password-types.t | 11 ++
t/api/user-prefs.t | 59 +++++++
t/fts/indexed_mysql.t | 2 +-
t/pod.t | 2 +-
t/web/path-traversal.t | 8 +
30 files changed, 263 insertions(+), 233 deletions(-)
create mode 100644 t/api/user-prefs.t
- Log -----------------------------------------------------------------
commit 618b21cb42a2449fb2c14f0e1218d9e24352a42f
Merge: c0cad6d f8e7797
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Fri Apr 25 19:12:00 2014 -0400
Merge branch '4.0-trunk' into 4.2-trunk
Conflicts:
lib/RT/StyleGuide.pod
Tabs had been removed on the 4.2 side, as well as minor updates for
moved elements and updated perl version. These changes were merged
into the more significant changes from 4.0-trunk.
share/html/Search/Chart
share/html/Search/Chart.html
share/html/Search/Elements/Chart
All of these fixed "bars" for the correct "bar" There were more
occurrences of "bars" in 4.2, which were adjusted during the merge.
t/api/date.t
Trivial test count conflict.
t/pod.t
4.2 made the testfile mandatory, 4.0 made it test additional
directories.
t/web/path-traversal.t
4.0 added new tests for allowing downloads of ".bashrc" files; the
requested URL (with no matching attachment) returns a different error
on 4.2 due to d9749a2f, as ->Load now returns false in scalar context
if the load failed.
diff --cc etc/RT_Config.pm.in
index fc8871b,c294d49..d01d1c7
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@@ -322,11 -295,19 +322,12 @@@ Set(@LogToSyslogConf, ())
=item C<$EmailSubjectTagRegex>
This regexp controls what subject tags RT recognizes as its own. If
- you're not dealing with historical C<$rtname> values, you'll likely
- never have to change this configuration.
+ you're not dealing with historical C<$rtname> values, or historical
+ queue-specific subject tags, you'll likely never have to change this
+ configuration.
Be B<very careful> with it. Note that it overrides C<$rtname> for
-subject token matching and that you should use only "non-capturing"
-parenthesis grouping. For example:
-
-C<Set($EmailSubjectTagRegex, qr/(?:example.com|example.org)/i );>
-
-and NOT
-
-C<Set($EmailSubjectTagRegex, qr/(example.com|example.org)/i );>
+subject token matching.
The setting below would make RT behave exactly as it does without the
setting enabled.
diff --cc lib/RT/StyleGuide.pod
index d45e04c,8fdfc7b..3a75562
--- a/lib/RT/StyleGuide.pod
+++ b/lib/RT/StyleGuide.pod
@@@ -85,27 -90,15 +89,15 @@@ major revision, the second number is th
number is the subversion. Odd-numbered versions are development
versions. Examples:
- 1.0.0 First release of RT 1
- 1.0.1 Second release of RT 1.0
- 1.0.10 etc.
- 1.1.0 First development release of RT 1.2 (or 2.0)
- 2.0.0 First release of RT 2
+ 1.0.0 First release of RT 1
+ 1.0.1 Second release of RT 1.0
+ 1.0.10 etc.
+ 1.1.0 First development release of RT 1.2 (or 2.0)
+ 2.0.0 First release of RT 2
- Versions can be modified with a hyphen followed by some text, for
- special versions, or to give extra information. Examples:
-
- 2.0.0-pre1 Notes that this is not final, but preview
-
- In perl 5.6.0, you can have versions like C<v2.0.0>, but this is not
- allowed in previous versions of perl. So to convert a tuple version
- string to a string to use with $VERSION, use a regular integer for
- the revision, and three digits for version and subversion. Examples:
+ Versions may end in "rc" and a number if they are release candidates:
- 1.1.6 -> 1.001006
- 2.0.0 -> 2.000000
-
- This way, perl can use the version strings in greater-than and
- less-than comparisons.
- 2.0.0rc1 First release candiate for real 2.0.0
++ 2.0.0rc1 First release candiate for real 2.0.0
=head2 Comments
@@@ -433,11 -357,11 +356,11 @@@ Do not use $_ (or assume it) except fo
clear what is going on, or when it is required (such as with
map() and grep()).
- for (@list) {
- print; # OK; everyone knows this one
- print uc; # wrong; few people know this
- print uc $_; # better
- }
+ for (@list) {
- print; # OK; everyone knows this one
- print uc; # wrong; few people know this
- print uc $_; # better
++ print; # OK; everyone knows this one
++ print uc; # wrong; few people know this
++ print uc $_; # better
+ }
Note that the special variable C<_> I<should> be used when possible.
It is a placeholder that can be passed to stat() and the file test
@@@ -446,22 -370,22 +369,22 @@@ example below, using C<$file> over for
C<_> for subsequent uses, is a performance hit. You should be
careful that the last-tested file is what you think it is, though.
- if (-d $file) { # $file is a directory
- # ...
- } elsif (-l _) { # $file is a symlink
- # ...
- }
+ if (-d $file) { # $file is a directory
- # ...
++ # ...
+ } elsif (-l _) { # $file is a symlink
- # ...
++ # ...
+ }
Package names begin with a capital letter in each word, followed by
lower case letters (for the most part). Multiple words should be StudlyCapped.
- RT::User # good
- RT::Database::MySQL # proper name
- RT::Display::Provider # good
- RT::CustomField # not so good, but OK
+ RT::User # good
+ RT::Database::MySQL # proper name
+ RT::Display::Provider # good
+ RT::CustomField # not so good, but OK
- Plugin modules should begin with "RTx::", followed by the name
+ Plugin modules should begin with "RT::Extension::", followed by the name
-of the plugin.
+of the plugin.
=head1 Code formatting
@@@ -504,20 -424,19 +423,19 @@@ before, with the exception of comment l
An example:
- # this is my function!
- sub foo {
- my $val = shift;
- my $obj = new Constructor;
- my($var1, $var2);
+ # this is my function!
+ sub foo {
- my $val = shift;
- my $obj = new Constructor;
- my($var1, $var2);
-
- $obj->SetFoo($val);
- $var1 = $obj->Foo();
++ my $val = shift;
++ my $obj = new Constructor;
++ my($var1, $var2);
- $obj->SetFoo($val);
- $var1 = $obj->Foo();
++ $obj->SetFoo($val);
++ $var1 = $obj->Foo();
- return($val);
- return($val);
- }
++ return($val);
+ }
- print 1;
+ print 1;
=head2 Parentheses
@@@ -553,16 -472,15 +471,15 @@@ On multi-line expressions, match up th
the opening statement, or the opening parenthesis, whichever works best.
Examples:
- @list = qw(
- bar
- baz
- ); # right
+ @list = qw(
- bar
- baz
++ bar
++ baz
+ ); # right
- if ($foo && $bar && $baz
- && $buz && $xyzzy) {
- print $foo;
- }
+ if ($foo && $bar && $baz
- && $buz && $xyzzy
- ) {
- print $foo;
++ && $buz && $xyzzy) {
++ print $foo;
+ }
Whether or not there is space following a closing parenthesis is
dependent on what it is that follows.
@@@ -618,28 -536,18 +535,18 @@@ Otherwise, finish each statement with
opening curly on the first line, and the ending curly lined up with the
keyword at the end.
- for (@list) {
- print;
- smell();
- }
+ for (@list) {
- print;
- smell();
++ print;
++ smell();
+ }
- Generally, we prefer "uncuddled elses":
+ Generally, we prefer "cuddled elses":
- if ($foo) {
- print;
- } else {
- die;
- }
+ if ($foo) {
- print;
- }
- else {
- die;
- }
-
- _If_ the if statement is very brief, sometimes "cuddling" the else makes code more readable. Feel free to cuddle them in that case:
-
-
- if ($foo) {
- print;
++ print;
+ } else {
- die;
++ die;
+ }
=head2 Operators
@@@ -681,17 -589,17 +588,17 @@@ Break long lines AFTER operators, excep
Try to keep the two parts to a binary operator (an operator that
has two operands) together when possible.
- print "foo" . "bar" . "baz"
- . "buz"; # wrong
-
- print "foo" . "bar" . "baz" .
- "buz"; # wrong
+ print "foo" . "bar" . "baz" .
- "buz"; # right
++ "buz"; # wrong
+
- print "foo" . "bar" . "baz"
- . "buz"; # right
++ print "foo" . "bar" . "baz"
++ . "buz"; # right
- print $foo unless $x == 3 && $y ==
- 4 && $z == 5; # wrong
+ print $foo unless $x == 3 && $y ==
+ 4 && $z == 5; # wrong
- print $foo unless $x == 3 && $y == 4
- && $z == 5; # right
+ print $foo unless $x == 3 && $y == 4
- && $z == 5; # right
++ && $z == 5; # right
=head2 Other
@@@ -780,15 -688,14 +687,14 @@@ should become <&|/l, $m->scom
-The string <& /Elements/TitleBoxStart, width=> "40%", titleright => "RT $RT::VERSION for RT->Config->Get('rtname')", title => 'Login' &>
+The string <& /Widgets/TitleBoxStart, width=> "40%", titleright => "RT $RT::VERSION for RT->Config->Get('rtname')", title => 'Login' &>
-should become <& /Elements/TitleBoxStart,
- width=> "40%",
- titleright => loc("RT [_1] for [_2]",$RT::VERSION, RT->Config->Get('rtname')),
- title => loc('Login'),
- &>
+should become <& /Widgets/TitleBoxStart,
+ width=> "40%",
+ titleright => loc("RT [_1] for [_2]",$RT::VERSION, RT->Config->Get('rtname')),
+ title => loc('Login'),
+ &>
-
=item Library code
diff --cc sbin/rt-test-dependencies.in
index 684feb9,263eab5..de63ddb
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@@ -58,13 -59,18 +59,16 @@@ use Cwd qw(abs_path)
my %args;
my %deps;
my @orig_argv = @ARGV;
+ # Save our path because installers or tests can change cwd
+ my $script_path = abs_path($0);
+
GetOptions(
\%args, 'v|verbose',
- 'install!', 'with-MYSQL',
- 'with-POSTGRESQL|with-pg|with-pgsql', 'with-SQLITE',
- 'with-ORACLE', 'with-FASTCGI',
- 'with-MODPERL1', 'with-MODPERL2',
- 'with-STANDALONE',
+ 'install!',
+ 'with-MYSQL', 'with-PG', 'with-SQLITE', 'with-ORACLE',
+ 'with-FASTCGI', 'with-MODPERL1', 'with-MODPERL2', 'with-STANDALONE',
- 'with-DEV',
+ 'with-DEVELOPER',
'with-GPG',
'with-ICAL',
diff --cc share/html/Elements/MakeClicky
index 75c44b6,8efe78c..3d9024c
--- a/share/html/Elements/MakeClicky
+++ b/share/html/Elements/MakeClicky
@@@ -131,8 -134,17 +134,17 @@@ $html => unde
</%ARGS>
<%INIT>
return unless defined $$content;
+ if ( defined $cache ) {
+ my $cached_content = $cache->(fetch => $content);
+ if ( $cached_content ) {
+ RT->Logger->debug("Found MakeClicky cache");
+ $$content = $cached_content;
+ return;
+ }
+ }
+
unless ( $regexp ) {
- RT::Interface::Web::EscapeUTF8( $content ) unless $html;
+ RT::Interface::Web::EscapeHTML( $content ) unless $html;
return;
}
diff --cc share/html/Search/Chart
index fd20036,7256106..c011635
--- a/share/html/Search/Chart
+++ b/share/html/Search/Chart
@@@ -46,118 -46,84 +46,118 @@@
%#
%# END BPS TAGGED BLOCK }}}
<%args>
+$Cache => undef
$Query => "id > 0"
-$PrimaryGroupBy => 'Queue'
+ at GroupBy => ()
- $ChartStyle => 'bars'
+ $ChartStyle => 'bar'
+ at ChartFunction => 'COUNT'
+$Width => undef
+$Height => undef
</%args>
<%init>
-my $chart_class;
use GD;
use GD::Text;
-if ($ChartStyle eq 'pie') {
- require GD::Graph::pie;
- $chart_class = "GD::Graph::pie";
-} else {
- require GD::Graph::bars;
- $chart_class = "GD::Graph::bars";
-}
+my %font_config = RT->Config->Get('ChartFont');
+my $font = $font_config{ $session{CurrentUser}->UserObj->Lang || '' }
+ || $font_config{'others'};
+
+s/\D//g for grep defined, $Width, $Height;
+$Width ||= 600;
+$Height ||= ($ChartStyle eq 'pie' ? $Width : 400);
+$Height = $Width if $ChartStyle eq 'pie';
+
+my $plot_error = sub {
+ my $text = shift;
+ my ($plot, $error);
+
+ my $create_plot = sub {
+ my ($width, $height) = @_;
+
+ my $plot = GD::Image->new($width => $height);
+ $plot->colorAllocate(255, 255, 255); # background
+ my $black = $plot->colorAllocate(0, 0, 0);
+
+ require GD::Text::Wrap;
+ my $error = GD::Text::Wrap->new($plot,
+ color => $black,
+ text => $text,
+ align => "left",
+ width => $width - 20,
+ preserve_nl => 1,
+ );
+ $error->set_font( $font, 16 );
+ return ($plot, $error);
+ };
+
+ ($plot, $error) = $create_plot->($Width, $Height);
+ my $text_height = ($error->get_bounds(0, 0))[3];
+
+ # GD requires us to replot it all with the new height
+ ($plot, $error) = $create_plot->($Width, $text_height + 20);
+
+ $error->draw(10, 10);
+ $m->comp( 'SELF:Plot', plot => $plot, %ARGS );
+};
use RT::Report::Tickets;
-my $tix = RT::Report::Tickets->new( $session{'CurrentUser'} );
-my %AllowedGroupings = reverse $tix->Groupings( Query => $Query );
-$PrimaryGroupBy = 'Queue' unless exists $AllowedGroupings{$PrimaryGroupBy};
-my ($count_name, $value_name) = $tix->SetupGroupings(
- Query => $Query, GroupBy => $PrimaryGroupBy,
-);
+my $report = RT::Report::Tickets->new( $session{'CurrentUser'} );
-my %class = (
- Queue => 'RT::Queue',
- Owner => 'RT::User',
- Creator => 'RT::User',
- LastUpdatedBy => 'RT::User',
-);
-my $class = $class{ $PrimaryGroupBy };
+my %columns;
+if ( $Cache and my $data = delete $session{'charts_cache'}{ $Cache } ) {
+ %columns = %{ $data->{'columns'} };
+ $report->Deserialize( $data->{'report'} );
+ $session{'i'}++;
+} else {
+ %columns = $report->SetupGroupings(
+ Query => $Query,
+ GroupBy => \@GroupBy,
+ Function => \@ChartFunction,
+ );
-my %data;
+ $report->SortEntries;
+}
+
+my @data = ([],[]);
my $max_value = 0;
+my $min_value;
my $max_key_length = 0;
-while ( my $entry = $tix->Next ) {
- my $key;
- if ( $class ) {
- my $q = $class->new( $session{'CurrentUser'} );
- $q->Load( $entry->LabelValue( $value_name ) );
- $key = $q->Name;
- }
- else {
- $key = $entry->LabelValue($value_name);
- }
- $key ||= '(no value)';
-
- my $value = $entry->__Value( $count_name );
- if ($chart_class eq 'GD::Graph::pie') {
- $key = loc($key) ." - ". $value;
- } else {
- $key = loc($key);
+while ( my $entry = $report->Next ) {
+ push @{ $data[0] }, [ map $entry->LabelValue( $_ ), @{ $columns{'Groups'} } ];
+
+ my @values;
+ foreach my $column ( @{ $columns{'Functions'} } ) {
+ my $v = $entry->RawValue( $column );
+ unless ( ref $v ) {
+ push @values, $v;
+ next;
+ }
+
+ my @subs = $report->FindImplementationCode(
+ $report->ColumnInfo( $column )->{'META'}{'SubValues'}
+ )->( $report );
+ push @values, map $v->{$_}, @subs;
}
- $data{ $key } = $value;
- $max_value = $value if $max_value < $value;
- $max_key_length = length $key if $max_key_length < length $key;
-}
-unless (keys %data) {
- $data{''} = 0;
+ my $i = 0;
+ push @{ $data[++$i] }, $_ foreach @values;
+
+ foreach my $v ( @values ) {
+ $max_value = $v if $max_value < $v;
+ $min_value = $v if !defined $min_value || $min_value > $v;
+ }
}
- $ChartStyle = 'bars' if @data > 2;
++$ChartStyle = 'bar' if @data > 2;
-my $chart = $chart_class->new( 600 => 400 );
-$chart->set( pie_height => 60 ) if $chart_class eq 'GD::Graph::pie';
-my %font_config = RT->Config->Get('ChartFont');
-my $font = $font_config{ $session{CurrentUser}->UserObj->Lang || '' }
- || $font_config{'others'};
-$chart->set_title_font( $font, 16 ) if $chart->can('set_title_font');
-$chart->set_legend_font( $font, 16 ) if $chart->can('set_legend_font');
-$chart->set_x_label_font( $font, 14 ) if $chart->can('set_x_label_font');
-$chart->set_y_label_font( $font, 14 ) if $chart->can('set_y_label_font');
-$chart->set_label_font( $font, 14 ) if $chart->can('set_label_font');
-$chart->set_x_axis_font( $font, 12 ) if $chart->can('set_x_axis_font');
-$chart->set_y_axis_font( $font, 12 ) if $chart->can('set_y_axis_font');
-$chart->set_values_font( $font, 12 ) if $chart->can('set_values_font');
-$chart->set_value_font( $font, 12 ) if $chart->can('set_value_font');
+my $chart_class;
+if ($ChartStyle eq 'pie') {
+ require GD::Graph::pie;
+ $chart_class = "GD::Graph::pie";
+} else {
+ require GD::Graph::bars;
+ $chart_class = "GD::Graph::bars";
+}
# Pie charts don't like having no input, so we show a special image
# that indicates an error message. Because this is used in an <img>
diff --cc share/html/Search/Chart.html
index 32fb651,ab25745..b280b11
--- a/share/html/Search/Chart.html
+++ b/share/html/Search/Chart.html
@@@ -46,12 -46,9 +46,12 @@@
%#
%# END BPS TAGGED BLOCK }}}
<%args>
-$PrimaryGroupBy => 'Queue'
+ at GroupBy => 'Status'
- $ChartStyle => 'bars'
+ $ChartStyle => 'bar'
+ at ChartFunction => ('COUNT')
$Description => undef
+$Width => undef
+$Height => undef
</%args>
<%init>
$m->callback( ARGSRef => \%ARGS, CallbackName => 'Initial' );
diff --cc share/html/Search/Elements/Chart
index 9a61843,f0d1e4a..d377f88
--- a/share/html/Search/Elements/Chart
+++ b/share/html/Search/Elements/Chart
@@@ -47,9 -47,8 +47,9 @@@
%# END BPS TAGGED BLOCK }}}
<%args>
$Query => "id > 0"
-$PrimaryGroupBy => 'Queue'
+ at GroupBy => ()
- $ChartStyle => 'bars'
+ $ChartStyle => 'bar'
+ at ChartFunction => 'COUNT'
</%args>
<%init>
use RT::Report::Tickets;
diff --cc t/api/password-types.t
index 7b75c62,10a874a..af95ebb
--- a/t/api/password-types.t
+++ b/t/api/password-types.t
@@@ -3,8 -3,10 +3,10 @@@ use warnings
use RT::Test;
use Digest::MD5;
+ use Encode 'encode_utf8';
+ use utf8;
-my $default = "sha512";
+my $default = "bcrypt";
my $root = RT::User->new(RT->SystemUser);
$root->Load("root");
diff --cc t/pod.t
index e3c530e,697a30b..11371b6
--- a/t/pod.t
+++ b/t/pod.t
@@@ -2,5 -2,6 +2,5 @@@ use strict
use warnings;
use Test::More;
-eval "use Test::Pod 1.14";
-plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
+use Test::Pod;
- all_pod_files_ok();
+ all_pod_files_ok( all_pod_files("lib","docs","etc","bin","sbin"));
diff --cc t/web/path-traversal.t
index cb44125,01302e6..9b45ba2
--- a/t/web/path-traversal.t
+++ b/t/web/path-traversal.t
@@@ -19,12 -20,24 +20,18 @@@ $agent->warning_like(qr/Invalid request
$agent->get("$baseurl/NoAuth/../../../etc/RT_Config.pm");
is($agent->status, 400);
-SKIP: {
- skip "Apache rejects busting up above / for us", 2 if $ENV{RT_TEST_WEB_HANDLER} =~ /^apache/;
- $agent->warning_like(qr/Invalid request.*aborting/,);
-};
+$agent->warning_like(qr/Invalid request.*aborting/) unless $ENV{RT_TEST_WEB_HANDLER} =~ /^apache/;
-$agent->get("$baseurl/NoAuth/css/web2/images/../../../../../../etc/RT_Config.pm");
-is($agent->status, 400);
-SKIP: {
- skip "Apache rejects busting up above / for us", 2 if $ENV{RT_TEST_WEB_HANDLER} =~ /^apache/;
- $agent->warning_like(qr/Invalid request.*aborting/,);
-};
+$agent->get("$baseurl/static/css/web2/images/../../../../../../etc/RT_Config.pm");
+# Apache hardcodes a 400m but the static handler returns a 403 for traversal too high
+is($agent->status, $ENV{RT_TEST_WEB_HANDLER} =~ /^apache/ ? 400 : 403);
+ # Do not reject a simple /. in the URL, for downloading uploaded
+ # dotfiles, for example.
+ $agent->get("$baseurl/Ticket/Attachment/28/9/.bashrc");
+ is($agent->status, 200); # Even for a file not found, we return 200
-$agent->content_contains("Bad attachment id");
++$agent->content_like(qr/Attachment \S+ could not be loaded/);
+
# do not reject these URLs, even though they contain /. outside the path
$agent->get("$baseurl/index.html?ignored=%2F%2E");
is($agent->status, 200);
-----------------------------------------------------------------------
More information about the rt-commit
mailing list