Rechnungen: Betraege mit Tausenderpunkt, XSS in Templates und Suche

- formularZahl(): steht ein Komma im Betrag, sind Punkte Tausendertrenner
  ("1.234,50" -> 1234.50, vorher 1.23); ohne Komma bleibt der Punkt
  Dezimaltrenner wie bei der Artikel-Autovervollstaendigung ("12.50").
- Rechnungs-Templates (addrechnung, mailrechnung, changeadr, copyrech,
  umschlagshow, rechshow) geben alle Daten mit |escape aus; Werte aus der
  URL (id, type, newtype) als int.
- Rechnungssuche: Artikelnamen werden escaped statt als HTML ausgegeben
  (Trennung per Zeilenumbruch in SQL, artikelListeHtml() in PHP).
- Suchbegriffe kommen per encodeURIComponent als UTF-8, utf8_encode()
  entfaellt; vorher gingen Zeichen ausserhalb von Latin-1 verloren.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-17 11:18:29 +02:00
co-authored by Claude Opus 5
parent d8fff4aeb6
commit b76d883fbe
12 changed files with 219 additions and 206 deletions
+5 -4
View File
@@ -16,7 +16,8 @@ if(!isset($err))
if(!isset($_GET["link"])){
$_GET["link"] ="";
}
$fulltag = utf8_encode($_GET["search"]);
// kommt per encodeURIComponent bereits als UTF-8
$fulltag = isset($_GET["search"]) && is_string($_GET["search"]) ? $_GET["search"] : "";
$src = explode(" ",$fulltag);
$combiner = $_GET["link"];
if($combiner != "AND" && $combiner != "OR")
@@ -87,14 +88,14 @@ if(!isset($err))
if($res["storno"] == 1){
$listlines[] = array("<a href='?action=rechshow&id=".$res["id"]."'><font color='#FF0000'>".$res["drechnr"]."</font></a>",
$res["date"],
$res["artikel"],
artikelListeHtml($res["artikel"]),
$actions
);
}
else{
$listlines[] = array("<a href='?action=rechshow&id=".$res["id"]."'>".$res["drechnr"]."</a>",
$res["date"],
$res["artikel"],
artikelListeHtml($res["artikel"]),
$actions
);
}
@@ -151,7 +152,7 @@ if(!isset($err))
{
$speciallines[] = array("<a href='?action=rechshow&id=".$res["id"]."'>".$res["rechnr"]."</a>",
$res["date"],
$res["artikel"],
artikelListeHtml($res["artikel"]),
"<span class='del' title='löschen' onClick='askdel(\"Möchten Sie das Dokument ".$res["rechnr"]."<br />wirklich <b>unwiederruflich</b> löschen?\",\"?action=rechadd&rechid=".$res["id"]."&del=1\")'></span>");
}
$headings = array("Nummer","Datum","Artikel","Aktion");
+5 -4
View File
@@ -22,7 +22,8 @@ if(!isset($err))
if(!isset($_GET["kdnid"])){
$_GET["kdnid"]="";
}
$fulltag = utf8_encode($_GET["search"]);
// kommt per encodeURIComponent bereits als UTF-8
$fulltag = isset($_GET["search"]) && is_string($_GET["search"]) ? $_GET["search"] : "";
$src = explode(" ",$fulltag);
$combiner = $_GET["link"];
if($combiner != "AND" && $combiner != "OR")
@@ -82,14 +83,14 @@ if(!isset($err))
if($res["storno"] == 1){
$listlines[] = array("<a href='?action=rechshow&id=".$res["id"]."'><font color='#FF0000'>".$res["drechnr"]."</font></a>",
$res["date"],
$res["artikel"],
artikelListeHtml($res["artikel"]),
$actions
);
}
else{
$listlines[] = array("<a href='?action=rechshow&id=".$res["id"]."'>".$res["drechnr"]."</a>",
$res["date"],
$res["artikel"],
artikelListeHtml($res["artikel"]),
$actions
);
}
@@ -142,7 +143,7 @@ if(!isset($err))
{
$speciallines[] = array("<a href='?action=rechshow&id=".$res["id"]."'>".$res["rechnr"]."</a>",
$res["date"],
$res["artikel"],
artikelListeHtml($res["artikel"]),
"<span class='del' title='löschen' onClick='askdel(\"Möchten Sie das Dokument ".$res["rechnr"]."<br />wirklich <b>unwiederruflich</b> löschen?\",\"?action=rechadd&rechid=".$res["id"]."&del=1\")'></span>");
}
$headings = array("Nummer","Datum","Artikel","Aktion");