noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 15/46: replace $_GET by httpInput


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 15/46: replace $_GET by httpInput
Date: Mon, 4 May 2020 13:38:45 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 775a7f358e35b75627bf76c484f1667789785759
Author: Dany De Bontridder <address@hidden>
AuthorDate: Wed Feb 26 22:42:30 2020 +0100

    replace $_GET by httpInput
---
 include/ajax/ajax_card.php | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/ajax/ajax_card.php b/include/ajax/ajax_card.php
index 5c291bc..9802158 100644
--- a/include/ajax/ajax_card.php
+++ b/include/ajax/ajax_card.php
@@ -96,6 +96,7 @@ $html=var_export($_REQUEST,true);
 // For storing extra information , example the HTML elt id to update
 // after creating
 $extra="";
+$http=new \HttpInput();
 switch($op2)
 {
     /* ------------------------------------------------------------ */
@@ -103,12 +104,11 @@ switch($op2)
     /* ------------------------------------------------------------ */
 case 'rmfa':
     if ($g_user->check_action(FICCAT)==0)exit();
-        ob_start();
-    if( ! isset($_GET['ad_id']) || isNumber($_GET['ad_id']) ==0)
-        throw new Exception ( _("Parametre ad_id est invalide"),11);
-    $ad_id=  $_GET['ad_id'];
+
+    ob_start();
     try
     {
+        $ad_id= $http->get("ad_id","number");
         $cn->start();
         $fa=new Fiche_Attr($cn,$ad_id);
         $fa->delete();
@@ -117,6 +117,7 @@ case 'rmfa':
     catch (Exception $e)
     {
         $cn->rollback();
+        record_log($e->getMessage());
         record_log($e->getTraceAsString());
         echo $e->getMessage();
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]