Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Zabezpieczenie odbieranych danych
foxbond
post 7.04.2010, 15:25:17
Post #1





Grupa: Zarejestrowani
Postów: 162
Pomógł: 12
Dołączył: 20.12.2009
Skąd: Siedlce

Ostrzeżenie: (0%)
-----


Mam taki kod:
  1. // by ŸFoxbond
  2.  
  3.  
  4. $_POST = array_map('stripslashes_deep', $_POST);
  5. $_GET = array_map('stripslashes_deep', $_GET);
  6. $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
  7.  
  8. }
  9. $_POST = array_map('addslashes_deep', $_POST);
  10. $_POST = array_map('html_deep', $_POST);
  11. $_GET = array_map('addslashes_deep', $_GET);
  12. $_GET = array_map('html_deep', $_GET);
  13. $_COOKIE = array_map('addslashes_deep', $_COOKIE);
  14. $_COOKIE = array_map('html_deep', $_COOKIE);
  15.  
  16. function stripslashes_deep($value) {
  17.  
  18. $value = is_array($value) ?
  19. array_map('stripslashes_deep', $value) :
  20. stripslashes($value);
  21. return $value;
  22.  
  23. }
  24.  
  25. function addslashes_deep($value) {
  26.  
  27. $value = is_array($value) ?
  28. array_map('addslashes_deep', $value) :
  29. addslashes($value);
  30. return $value;
  31.  
  32. }
  33.  
  34. function html_deep($value) {
  35.  
  36. $value = is_array($value) ?
  37. array_map('html_deep', $value) :
  38. return $value;
  39.  
  40. }


Czy jeśli umieszczę go na początku każdego skryptu (require) to będzie wystarczającym zabezpieczeniem??

Ten post edytował foxbond 8.04.2010, 13:25:01
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 28.06.2025 - 04:02