[Koha-bugs] [Bug 13941] Add ids to <body> tag in staff client where missing

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Apr 14 14:07:58 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13941

--- Comment #23 from Frédéric Demians <frederic at tamil.fr> ---
(In reply to Jonathan Druart from comment #22)
> Comment on attachment 37781 [details] [review]
> [Signed-off] Bug 13941 [1/2] Test <body> tag with id/class attributes
> 
> Review of attachment 37781 [details] [review]:
> -----------------------------------------------------------------
> 
> ::: xt/tt_valid.t
> @@ +55,5 @@
> > +        description => '<body> tag with id and class attributes',
> > +        check => sub {
> > +            my ($self, $name, $token) = @_;
> > +            return if $name =~ /bodytag\.inc/;
> > +            $_ = $token->{_string};
> 
> Sorry but I still don't understand why this is useful.

The sub complete code is:

            my ($self, $name, $token) = @_;
            return if $name =~ /bodytag\.inc/;
            $_ = $token->{_string};
            push @{$self->{errors}->{$name}}, $token->{_lc}
              if /^<body/ && ! /id=".+"/ && ! /class=".+"/;

The $_ is used in the last line which should have been coded like that without
$_ assignation:

  if $token->{_string} =~ $/^<body/ &&
     ! $token->{_string} =~ /id=".+"/ &&
     ! $token->{_string} =~ /class=".+"/;

Hope this explanation doesn't obfuscate more something which isn't already that
clear.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list