Explorar el Código

防止sql注入

visuddhinanda hace 4 años
padre
commit
5ff4e5509b
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      app/pcdl/get_res_index.php

+ 2 - 2
app/pcdl/get_res_index.php

@@ -12,7 +12,7 @@ if (isset($_COOKIE["language"])) {
 require_once "language/db_{$lang}.php";
 require_once "language/db_{$lang}.php";
 
 
 if (isset($_GET["book"])) {
 if (isset($_GET["book"])) {
-    $book = $_GET["book"];
+    $book = (int)$_GET["book"];
 } else {
 } else {
     echo "no book id";
     echo "no book id";
     exit;
     exit;
@@ -28,7 +28,7 @@ if (isset($_GET["album"])) {
 }
 }
 
 
 if (isset($_GET["paragraph"])) {
 if (isset($_GET["paragraph"])) {
-    $paragraph = $_GET["paragraph"];
+    $paragraph = (int)$_GET["paragraph"];
 } else {
 } else {
     $paragraph = -1;
     $paragraph = -1;
 }
 }