X-Git-Url: https://git.p6c8.net/selfforum.git/blobdiff_plain/5c8a814d80027a517d1094008d6af063457fc6eb..aa8d61528704dd0f5b5567f535161ffdecf4a135:/selfforum-cgi/shared/Encode/Plain.pm?ds=sidebyside diff --git a/selfforum-cgi/shared/Encode/Plain.pm b/selfforum-cgi/shared/Encode/Plain.pm index 17c749c..2379e38 100644 --- a/selfforum-cgi/shared/Encode/Plain.pm +++ b/selfforum-cgi/shared/Encode/Plain.pm @@ -4,7 +4,7 @@ package Encode::Plain; # # # File: shared/Encode/Plain.pm # # # -# Authors: André Malo , 2001-04-12 # +# Authors: André Malo # # # # Description: Encode text for HTML Output (entities, spaces) # # # @@ -19,6 +19,16 @@ use vars qw( $v56 ); +################################################################################ +# +# Version check +# +# last modified: +# $Date$ (GMT) +# by $Author$ +# +sub VERSION {(q$Revision$ =~ /([\d.]+)\s*$/)[0] or '0.0'} + $v56 = eval {local $SIG{__DIE__}; require 5.6.0;}; ################################################################################ @@ -129,7 +139,6 @@ sub plain ($;$) { if ($except) { $new =~ s/($exreg)|/defined($1)?$1:'>'/eg; - $new =~ s/($exreg)|\|/defined($1)?$1:'|'/eg; $new =~ s/($exreg)|"/defined($1)?$1:'"'/eg; # the big hash @@ -164,7 +173,6 @@ sub plain ($;$) { # $new =~ s//>/g; - $new =~ s/\|/|/g; $new =~ s/"/"/g; # the big hash @@ -225,7 +233,7 @@ sub multiline ($) { # turn \n into
# - $string=~s/\n/
/g; + $string=~s!\n!
!g; # more than 1 space =>   # @@ -234,7 +242,7 @@ sub multiline ($) { # Single Spaces after
=>   # (save ascii arts ;) # - $string=~s/(?:^|(
))\s/($1?$1:'').' '/eg; + $string=~s!(?:^|())\s!($1?$1:'').' '!eg; # return # @@ -255,17 +263,11 @@ sub toUTF8 ($) { ? $$ref : $ref; -# if ($v56) { -# no warnings 'utf8'; -# $string =~ tr/\x80-\xff//CU; -# } -# else { - $string =~ s - {([\x80-\xff])} - { chr((ord ($1) >> 6) | 192) - .chr((ord ($1) & 191)) - }eg; -# } + $string =~ s + {([\x80-\xff])} + { chr((ord ($1) >> 6) | 192) + .chr((ord ($1) & 191)) + }eg; ref($ref) ? \$string @@ -526,9 +528,9 @@ BEGIN { ); } -# keeping require happy +# keep 'require' happy 1; # # -### end of Encode::Plain ####################################################### +### end of Encode::Plain ####################################################### \ No newline at end of file