]> git.koha-community.org Git - koha.git/commit
bug 2315: no crash if subfield code is a metacharacter
authorGalen Charlton <galen.charlton@liblime.com>
Mon, 7 Jul 2008 22:17:05 +0000 (17:17 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 8 Jul 2008 14:36:11 +0000 (09:36 -0500)
commit386b4b15a15d4ef1798087ac6ed303db9f55755b
treecd98d22a3f963c484c676191f2935535c2f2343a
parent4e11790cbc5c89ea1a0139799bcd0e29bff80bcb
bug 2315: no crash if subfield code is a metacharacter

When generating the display form of a heading that
happens to (invalidly) have a regular expression
metacharacter as a subfield label, do not crash.

An example of such a heading field is:

  <datafield tag="650" ind1=" " ind2="0">
    <subfield code="a">Dalziel, Andrew (Fictitious character</subfield>
    <subfield code=")">xFiction.</subfield>
  </datafield>

The error message associated with the crash is:

  Unmatched ) in regex; marked by <-- HERE in m/) <-- HERE / at
  /home/koha-pro/kohaclone/C4/Heading/MARC21.pm line 220.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Heading/MARC21.pm
t/lib/KohaTest/Heading.pm [new file with mode: 0644]
t/lib/KohaTest/Heading/MARC21.pm [new file with mode: 0644]