Apply latex_encode on each element of item cell
authorJoey Schulze <joey@infodrom.org>
Wed, 26 Dec 2012 23:11:05 +0000 (00:11 +0100)
committerJoey Schulze <joey@infodrom.org>
Wed, 26 Dec 2012 23:11:05 +0000 (00:11 +0100)
utils.php

index f998ced..78292c6 100644 (file)
--- a/utils.php
+++ b/utils.php
@@ -158,17 +158,17 @@ function ordersatz_write($id, $dir, $send)
   $f = fopen(FNAME_ITEMS, 'w');
 
   foreach ($result as $row) {
-    $bez = $row['bezeichnung'];
+    $bez = latex_encode($row['bezeichnung']);
     if (strlen($row['hersteller']))
-      $bez .= ' (' . $row['hersteller'] . ')';
+      $bez .= ' (' . latex_encode($row['hersteller']) . ')';
     if (strlen($row['hinweis']))
-      $bez .= sprintf("\\newline\\textbf{%s}", $row['hinweis']);
+      $bez .= sprintf("\\newline\\textbf{%s}", latex_encode($row['hinweis']));
 
     fwrite($f, sprintf('\order{%d}{%s}{%s %s}{%s}'."\n",
                       $row['anzahl'],
                       $row['artnr'] ? (int)$row['artnr'] : '',
                       $row['menge'],
-                      latex_encode($bez),
+                      $bez,
                       latex_encode($row['vpname'])));
   }