From 8f99a6e4fd14417d4724241f30d154abdc27e789 Mon Sep 17 00:00:00 2001 From: ndparker <> Date: Wed, 25 Apr 2001 22:42:00 +0000 Subject: [PATCH] fixed some bugs --- selfforum-cgi/shared/CheckRFC.pm | 2 +- selfforum-cgi/shared/Encode/Posting.pm | 9 ++++----- selfforum-cgi/shared/Posting/_lib.pm | 2 +- selfforum-cgi/user/fo_posting.pl | 18 +++++++++--------- selfforum-cgi/user/fo_view.pl | 18 +++++++++--------- selfforum-cgi/user/fo_voting.pl | 18 +++++++++--------- 6 files changed, 33 insertions(+), 34 deletions(-) diff --git a/selfforum-cgi/shared/CheckRFC.pm b/selfforum-cgi/shared/CheckRFC.pm index ddde67f..1441038 100644 --- a/selfforum-cgi/shared/CheckRFC.pm +++ b/selfforum-cgi/shared/CheckRFC.pm @@ -141,7 +141,7 @@ BEGIN { @email = (); for $domain ( - qq< $sub_domain (?: $Period $X $sub_domain )+ >, + qq< $sub_domain (?: $Period $X $sub_domain )* $Period [A-Za-z][A-Za-z][A-Za-z]?[A-Za-z]? >, qq< $sub_domain (?: $Period $X $sub_domain )* > ) { my $route = qq< \@ $X $domain (?: , $X \@ $X $domain )* : $X >; diff --git a/selfforum-cgi/shared/Encode/Posting.pm b/selfforum-cgi/shared/Encode/Posting.pm index e35e648..ffafbf1 100644 --- a/selfforum-cgi/shared/Encode/Posting.pm +++ b/selfforum-cgi/shared/Encode/Posting.pm @@ -60,7 +60,7 @@ sub encoded_body ($;$) { my $params = shift; $posting =~ s/\015\012|\015|\012/\n/g; # normalize newlines - $posting =~ s/[^\S\n]$//gm; # kill whitespaces at the end of all lines + $posting =~ s/[^\S\n]+$//gm; # kill whitespaces at the end of all lines $posting =~ s/\s+$//; # kill whitespaces (newlines) at the end of the string (text) # check the special syntaxes: @@ -73,7 +73,7 @@ sub encoded_body ($;$) { my @links = grep { is_URL ( $_ -> [1] => ':ALL') or is_URL (($_ -> [1] =~ /^[Vv][Ii][Ee][Ww]-[Ss][Oo][Uu][Rr][Cc][Ee]:(.+)/)[0] || '' => 'http') - or ( $_ -> [1] =~ m<^\.?\.?/(?!/)|\?> + or ( $_ -> [1] =~ m<^(?:\.?\.?/(?!/)|\?)> and is_URL (rel_uri ($_ -> [1], $base) => 'http')) } @rawlinks; @@ -83,7 +83,7 @@ sub encoded_body ($;$) { push @rawimages => [$1 => $2] while ($posting =~ /\[([Ii][Mm][Aa][Gg][Ee]):\s*([^\]\s]+)\s*\]/g); my @images = grep { is_URL ($_ -> [1] => 'strict_http') - or ( $_ -> [1] =~ m<^\.?\.?/(?!/)|\?> + or ( $_ -> [1] =~ m<^(?:\.?\.?/(?!/)|\?)> and is_URL (rel_uri ($_ -> [1], $base) => 'http')) } @rawimages; @@ -93,8 +93,7 @@ sub encoded_body ($;$) { push @rawiframes => [$1 => $2] while ($posting =~ /\[([Ii][Ff][Rr][Aa][Mm][Ee]):\s*([^\]\s]+)\s*\]/g); my @iframes = grep { is_URL ($_ -> [1] => 'http') - or is_URL (($_ -> [1] =~ /^[Vv][Ii][Ee][Ww]-[Ss][Oo][Uu][Rr][Cc][Ee]:(.+)/)[0] || '' => 'http') - or ( $_ -> [1] =~ m<^\.?\.?/(?!/)|\?> + or ( $_ -> [1] =~ m<^(?:\.?\.?/(?!/)|\?)> and is_URL (rel_uri ($_ -> [1], $base) => 'http')) } @rawiframes; diff --git a/selfforum-cgi/shared/Posting/_lib.pm b/selfforum-cgi/shared/Posting/_lib.pm index 630a1e1..94f6af4 100644 --- a/selfforum-cgi/shared/Posting/_lib.pm +++ b/selfforum-cgi/shared/Posting/_lib.pm @@ -75,6 +75,7 @@ sub create_message ($$) { my $header = $xml -> createElement ('Header'); my $author = $xml -> createElement ('Author'); + $header -> appendChild ($author); my @may = ( ['name' => 'Name' => $author], @@ -104,7 +105,6 @@ sub create_message ($$) { my $date = $xml -> createElement ('Date'); $date -> setAttribute ('longSec'=> $par -> {time}); - $header -> appendChild ($author); $header -> appendChild ($date); $message -> appendChild ($header); diff --git a/selfforum-cgi/user/fo_posting.pl b/selfforum-cgi/user/fo_posting.pl index c78cab7..a2d756e 100644 --- a/selfforum-cgi/user/fo_posting.pl +++ b/selfforum-cgi/user/fo_posting.pl @@ -21,17 +21,17 @@ use vars qw( # locate the script # BEGIN { -# my $null = $0; $null =~ s/\\/\//g; # for win :-( -# $Bin = ($null =~ /^(.*)\/.*$/)? $1 : '.'; -# $Shared = "$Bin/../shared"; -# $Config = "$Bin/config"; -# $Script = ($null =~ /^.*\/(.*)$/)? $1 : $null; - - my $null = $0; #$null =~ s/\\/\//g; # for win :-( + my $null = $0; $null =~ s/\\/\//g; # for win :-( $Bin = ($null =~ /^(.*)\/.*$/)? $1 : '.'; - $Config = "$Bin/../../../cgi-config/devforum"; - $Shared = "$Bin/../../../cgi-shared"; + $Shared = "$Bin/../shared"; + $Config = "$Bin/config"; $Script = ($null =~ /^.*\/(.*)$/)? $1 : $null; + +# my $null = $0; #$null =~ s/\\/\//g; # for win :-( +# $Bin = ($null =~ /^(.*)\/.*$/)? $1 : '.'; +# $Config = "$Bin/../../../cgi-config/devforum"; +# $Shared = "$Bin/../../../cgi-shared"; +# $Script = ($null =~ /^.*\/(.*)$/)? $1 : $null; } use lib "$Shared"; diff --git a/selfforum-cgi/user/fo_view.pl b/selfforum-cgi/user/fo_view.pl index 37260e3..7470dc7 100644 --- a/selfforum-cgi/user/fo_view.pl +++ b/selfforum-cgi/user/fo_view.pl @@ -19,17 +19,17 @@ use vars qw( ); BEGIN { -# my $null = $0; $null =~ s/\\/\//g; # for win :-( -# $Bin = ($null =~ /^(.*)\/.*$/)? $1 : '.'; -# $Shared = "$Bin/../shared"; -# $Config = "$Bin/config"; -# $Script = ($null =~ /^.*\/(.*)$/)? $1 : $null; - - my $null = $0; #$null =~ s/\\/\//g; # for win :-( + my $null = $0; $null =~ s/\\/\//g; # for win :-( $Bin = ($null =~ /^(.*)\/.*$/)? $1 : '.'; - $Config = "$Bin/../../../cgi-config/devforum"; - $Shared = "$Bin/../../../cgi-shared"; + $Shared = "$Bin/../shared"; + $Config = "$Bin/config"; $Script = ($null =~ /^.*\/(.*)$/)? $1 : $null; + +# my $null = $0; #$null =~ s/\\/\//g; # for win :-( +# $Bin = ($null =~ /^(.*)\/.*$/)? $1 : '.'; +# $Config = "$Bin/../../../cgi-config/devforum"; +# $Shared = "$Bin/../../../cgi-shared"; +# $Script = ($null =~ /^.*\/(.*)$/)? $1 : $null; } use lib "$Shared"; diff --git a/selfforum-cgi/user/fo_voting.pl b/selfforum-cgi/user/fo_voting.pl index 284857e..7dddc53 100644 --- a/selfforum-cgi/user/fo_voting.pl +++ b/selfforum-cgi/user/fo_voting.pl @@ -19,17 +19,17 @@ use vars qw( ); BEGIN { -# my $null = $0; $null =~ s/\\/\//g; # for win :-( -# $Bin = ($null =~ /^(.*)\/.*$/)? $1 : '.'; -# $Shared = "$Bin/../shared"; -# $Config = "$Bin/config"; -# $Script = ($null =~ /^.*\/(.*)$/)? $1 : $null; - - my $null = $0; #$null =~ s/\\/\//g; # for win :-( + my $null = $0; $null =~ s/\\/\//g; # for win :-( $Bin = ($null =~ /^(.*)\/.*$/)? $1 : '.'; - $Config = "$Bin/../../../cgi-config/devforum"; - $Shared = "$Bin/../../../cgi-shared"; + $Shared = "$Bin/../shared"; + $Config = "$Bin/config"; $Script = ($null =~ /^.*\/(.*)$/)? $1 : $null; + +# my $null = $0; #$null =~ s/\\/\//g; # for win :-( +# $Bin = ($null =~ /^(.*)\/.*$/)? $1 : '.'; +# $Config = "$Bin/../../../cgi-config/devforum"; +# $Shared = "$Bin/../../../cgi-shared"; +# $Script = ($null =~ /^.*\/(.*)$/)? $1 : $null; } use lib $Shared; -- 2.34.1