cvs commit: p5ee/App-Widget/lib/App Widget.pm

[email protected] (Stephen Adkins)
Newsgroups perl.cvs.p5ee
Message-ID <[email protected]>
cvsuser     06/02/28 14:02:31

  Modified:    App-Widget/lib/App Widget.pm
  Log:
  fixed unbalance sub_entry()/sub_exit()
  
  Revision  Changes    Path
  1.9       +11 -7     p5ee/App-Widget/lib/App/Widget.pm
  
  Index: Widget.pm
  ===================================================================
  RCS file: /cvs/public/p5ee/App-Widget/lib/App/Widget.pm,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Widget.pm	28 Oct 2005 17:18:54 -0000	1.8
  +++ Widget.pm	28 Feb 2006 22:02:31 -0000	1.9
  @@ -418,11 +418,15 @@
   sub html_escape {
       &App::sub_entry if ($App::trace);
       my ($self, $text) = @_;
  -    return "" if (!defined $text || $text eq "");
  -    $text =~ s{&}{&amp;}gso;
  -    $text =~ s{<}{&lt;}gso;
  -    $text =~ s{>}{&gt;}gso;
  -    $text =~ s{\"}{&quot;}gso;
  +    if (!defined $text) {
  +        $text = "";
  +    }
  +    elsif ($text) {
  +        $text =~ s{&}{&amp;}gso;
  +        $text =~ s{<}{&lt;}gso;
  +        $text =~ s{>}{&gt;}gso;
  +        $text =~ s{\"}{&quot;}gso;
  +    }
       &App::sub_exit($text) if ($App::trace);
       return $text;
   }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.