Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item9693: Clean up some stuff
  • Loading branch information
gac410 committed Jan 1, 2015
1 parent ead79ae commit 34cb74a
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 18 deletions.
4 changes: 2 additions & 2 deletions UnitTestContrib/test/unit/Fn_ENCODE.pm
Expand Up @@ -110,8 +110,8 @@ THIS

sub test_old_new_3 {
my $this = shift;
my $in = '%ENCODE{"spreadsheet" old="ee,sp" new="i,"}%';
my $out = 'readshit';
my $in = '%ENCODE{"spreadsheet" old="heet,sp" new="tuf,"}%';
my $out = 'readstuf';
$this->assert_equals( $out, $this->{test_topicObject}->expandMacros($in) );
}

Expand Down
2 changes: 1 addition & 1 deletion UnitTestContrib/test/unit/Fn_SEARCH.pm
Expand Up @@ -4043,7 +4043,7 @@ sub _cut_the_crap {
return $result;
}

sub test_no_format_no_shit {
sub test_no_format_no_junk {
my $this = shift;

my $result = $this->{test_topicObject}->expandMacros('%SEARCH{"BLEEGLE"}%');
Expand Down
2 changes: 1 addition & 1 deletion UnitTestContrib/test/unit/Fn_WEBLIST.pm
Expand Up @@ -41,7 +41,7 @@ sub set_up {

}

# The spec of the "webs" and "subwebs" parameters are utterly fucked.
# The spec of the "webs" and "subwebs" parameters are utterly broken.
# "webs" specifies a set of webs to consider. If it is undefined, then it
# defaults to all root level webs. Otherwise it is treated as an ordered
# list of web names. There are two pseudo-webs that can be included in this
Expand Down
2 changes: 1 addition & 1 deletion UnitTestContrib/test/unit/FuncTests.pm
Expand Up @@ -517,7 +517,7 @@ NONNY
)
);

# This should fail and return an oopsUrl (FFS, what a shit spec)
# This should fail and return an oopsUrl (FFS, what a poor spec)
my $oopsURL =
Foswiki::Func::saveTopicText( $this->{test_web}, $topic, 'Gasp' );
$this->assert($oopsURL);
Expand Down
22 changes: 11 additions & 11 deletions UnitTestContrib/test/unit/RobustnessTests.pm
Expand Up @@ -84,7 +84,7 @@ sub test_validateAttachmentName {
return;
}

sub _shittify {
sub _sanitize {
my ( $a, $b ) = Foswiki::Sandbox::sanitizeAttachmentName(shift);
return $a;
}
Expand Down Expand Up @@ -124,11 +124,11 @@ sub test_sanitizeAttachmentName {
my $this = shift;

# Check that leading paths are stripped
$this->assert_str_equals( "abc", _shittify("abc") );
$this->assert_str_equals( "abc", _shittify("./abc") );
$this->assert_str_equals( "abc", _shittify("\\abc") );
$this->assert_str_equals( "abc", _shittify("//abc") );
$this->assert_str_equals( "abc", _shittify("\\\\abc") );
$this->assert_str_equals( "abc", _sanitize("abc") );
$this->assert_str_equals( "abc", _sanitize("./abc") );
$this->assert_str_equals( "abc", _sanitize("\\abc") );
$this->assert_str_equals( "abc", _sanitize("//abc") );
$this->assert_str_equals( "abc", _sanitize("\\\\abc") );

# Check that "certain characters" are munched
my $crap = '';
Expand All @@ -141,7 +141,7 @@ sub test_sanitizeAttachmentName {
$this->assert_num_equals( 51, length($crap) );
my $x = $crap =~ / / ? '_' : '';
$this->assert_str_equals( "pick_me${x}pick_me",
_shittify("pick me${crap}pick me") );
_sanitize("pick me${crap}pick me") );
my %junkset = (
'<script>' => 'script',
'%3cscript%3e' => '3cscript3e',
Expand All @@ -161,7 +161,7 @@ sub test_sanitizeAttachmentName {
#"foo\x9ffoo" => 'foofoo', # C1 Control
);
while ( my ( $junk, $filtered ) = each %junkset ) {
$this->assert_str_equals( $filtered, _shittify($junk) );
$this->assert_str_equals( $filtered, _sanitize($junk) );
}

# Check that the upload filter is applied.
Expand All @@ -172,16 +172,16 @@ sub test_sanitizeAttachmentName {
| pl
| py
| cgi ))$)x;
$this->assert_str_equals( ".htaccess.txt", _shittify(".htaccess") );
$this->assert_str_equals( ".htaccess.txt", _sanitize(".htaccess") );
for my $i (qw(php shtm phtml pl py cgi PHP SHTM PHTML PL PY CGI)) {
my $j = "bog.$i";
my $y = "$j.txt";
$this->assert_str_equals( $y, _shittify($j) );
$this->assert_str_equals( $y, _sanitize($j) );
}
for my $i (qw(php phtm shtml PHP PHTM SHTML)) {
my $j = "bog.$i.s";
my $y = "$j.txt";
$this->assert_str_equals( $y, _shittify($j) );
$this->assert_str_equals( $y, _sanitize($j) );
}

return;
Expand Down
1 change: 0 additions & 1 deletion core/lib/Foswiki/Infix/Error.pm
Expand Up @@ -25,7 +25,6 @@ BEGIN {

sub new {
my ( $class, $message, $expr, $at ) = @_;
Carp::confess "FUCK" if $message =~ /PPOPOO/;
if ( defined $expr && length($expr) ) {
$message .= " in '$expr'";
}
Expand Down
2 changes: 1 addition & 1 deletion core/lib/Foswiki/Macros/INCLUDE.pm
Expand Up @@ -125,7 +125,7 @@ sub _includeProtocol {
eval 'use Foswiki::IncludeHandlers::' . $handler . ' ()';
if ($@) {
return $this->_includeWarning( $control->{warn}, 'bad_include_path',
"FUCKED UP $handler for " . $control->{_DEFAULT} );
"BROKEN $handler for " . $control->{_DEFAULT} );
}
else {
$handler = 'Foswiki::IncludeHandlers::' . $handler;
Expand Down

0 comments on commit 34cb74a

Please sign in to comment.