https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22497

            Bug ID: 22497
           Summary: '0' width can lead to an infinite loop.
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P5 - low
         Component: Label/patron card printing
          Assignee: [email protected]
          Reporter: [email protected]
        QA Contact: [email protected]
  Target Milestone: ---

> > "Aha... it's the parentheses which are the problem. They're being 
> > interpreted as 
> > regex metacharacters and not literal values!" 
> 
> We noticed that there seems to be an infinite loop if the template has some
> or all entries with "0" in it (like in default when creating a new
> template). Could this be the same cause?


Sorry, I just realized that you were referring to the template rather than the
layout. 

Yes, it would be a related problem, but a separate issue. 

If 'label_width' is 0, then $self->{'width'} will be 0. 

That means that this condition will be triggered:

if (($string_width + $text_attribs->{'llx'}) > $self->{'width'})

And because $self->{'width'} is 0, then the following condition would never
feasibly be triggered:

if (($string_width + $text_attribs->{'llx'}) < $self->{'width'}) 

And this condition is the only thing that can stop the infinite loop.

Really the line wrapping code looks like it would benefit from a re-write.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to