[Bug 22497] New: '0' width can lead to an infinite loop.
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: cnighswonger@foundations.edu Reporter: martin.renvoize@ptfs-europe.com QA Contact: testopia@bugs.koha-community.org 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22497 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=22429 Depends on| |22429 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22429 [Bug 22429] Infinite loop in patron card printing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22497 --- Comment #1 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- See bug 22429 for context -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22497 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on|22429 | Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22429 [Bug 22429] Infinite loop in patron card printing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22497 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |22429 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22429 [Bug 22429] Infinite loop in patron card printing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22497 Christian Stelzenmüller <christian.stelzenmueller@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |christian.stelzenmueller@bs | |z-bw.de See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=22462 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22497 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22497 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Martin Renvoize from comment #0)
Really the line wrapping code looks like it would benefit from a re-write.
Should not we go for a quick fix instead? Like last if $width == 0? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22497 --- Comment #3 from David Cook <dcook@prosentient.com.au> --- (In reply to Jonathan Druart from comment #2)
(In reply to Martin Renvoize from comment #0)
Really the line wrapping code looks like it would benefit from a re-write.
Should not we go for a quick fix instead? Like last if $width == 0?
I was thinking something like: last if $text_attribs->{'llx'}) >= $self->{'width'} Although that's just off the top of my head. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22497 --- Comment #4 from David Cook <dcook@prosentient.com.au> --- And I really mean off the top of my head. Like maybe that should be: last if $text_attribs->{'llx'}) > $self->{'width'} I can't recall the exact interplay between those two values -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22497 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|major |normal -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org