Bug 22429: Infinite loop in patron card printing
authorDavid Cook <dcook@prosentient.com.au>
Mon, 4 Mar 2019 06:43:29 +0000 (17:43 +1100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 19 Mar 2019 09:33:49 +0000 (09:33 +0000)
commit296f6756ab51103d0e104e16cff312d28a8fd165
treeebbf95cd950a5ba0e4c1140adbf1af03ec7d943c
parentb45f8d066e40d16245a838a95c6fc61706cededb
Bug 22429: Infinite loop in patron card printing

Text fields in Patron Card Text Layouts can contain regular
expression metacharacters, which - instead of being treated as
literal values - are interpreted and prevent line wrapping. This
causes the process to get stuck in an infinite loop, which keeps
running even after the web server has timed out (at least when
using CGI).

This patch escapes the relevant input from the text field so the
regular expression substitution treats characters as literals
instead of as metacharacters.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 3bd900496690375b2b711743ffaa57371388f687)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Patroncards/Patroncard.pm