Преглед изворни кода

Fix sql injection in bm_show_document and bm_make_faktura

Piotr Labudda пре 11 година
родитељ
комит
926e83b106
2 измењених фајлова са 16 додато и 3 уклоњено
  1. 8 2
      SE/superedit-bm_make_faktura.php
  2. 8 1
      SE/superedit-bm_show_document.php

+ 8 - 2
SE/superedit-bm_make_faktura.php

@@ -4,8 +4,14 @@ function bm_make_faktura() {
 	Lib::loadClass('TableAcl');
 	Lib::loadClass('TableAcl');
 	Lib::loadClass('UserAcl');
 	Lib::loadClass('UserAcl');
 	Lib::loadClass('Billing_html');
 	Lib::loadClass('Billing_html');
-	$billing = new Billing_html('931');
 
 
-	$billing->set_client_filter = $_REQUEST['ARG1_VAL'];
+	$idKlient = V::get('ARG1_VAL', 0, $_REQUEST, 'int');
+	if ($idKlient <= 0) {
+		echo '<div class="alert alert-danger">Błędny numer klienta!</div>';
+		return;
+	}
+
+	$billing = new Billing_html('931');
+	$billing->set_client_filter = $idKlient;
 	$billing->showListaFaktur();
 	$billing->showListaFaktur();
 }
 }

+ 8 - 1
SE/superedit-bm_show_document.php

@@ -4,7 +4,14 @@ function bm_show_document() {
 	Lib::loadClass('TableAcl');
 	Lib::loadClass('TableAcl');
 	Lib::loadClass('UserAcl');
 	Lib::loadClass('UserAcl');
 	Lib::loadClass('Billing_html');
 	Lib::loadClass('Billing_html');
+
+	$idDocument = V::get('ARG1_VAL', 0, $_REQUEST, 'int');
+	if ($idDocument <= 0) {
+		echo '<div class="alert alert-danger">Błędny numer dokumentu!</div>';
+		exit;
+	}
+
 	$billing = new Billing_html('931');
 	$billing = new Billing_html('931');
-	$billing->bm_show_document($_REQUEST['ARG1_VAL']);
+	$billing->bm_show_document($idDocument);
 	exit;
 	exit;
 }
 }