X-Git-Url: https://git.p6c8.net/selfforum.git/blobdiff_plain/489e7846289d4fb66eb4b9fab0fed4af719b98ee..b9021e9738004ee35018d3ec16495b7dc1a287f0:/selfforum-cgi/shared/Encode/Plain.pm diff --git a/selfforum-cgi/shared/Encode/Plain.pm b/selfforum-cgi/shared/Encode/Plain.pm index f2085ce..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,7 +528,7 @@ BEGIN { ); } -# keeping require happy +# keep 'require' happy 1; #