<!--quoteo--><div class='quotetop'>Cytat</div><div class='quotemain'><!--quotec-->/* * Funkcja sprawdza czy $data jest typu $expected_data_type (int, string) i zwraca true lub false jezeli $data nie jest poprawna * do uzycia w zapytaniu SQL * $secure_level = 0, nie zwraca uwagi na wystepowanie SELECT, UNION, *, dla $secure_level = 1, zwraca uwage na wystepowanie skladni SQL */ function is_safe_data( $data, $expected_data_type = 'int', $secure_level = 0 ) { if( $expected_data_type == 'int' ) { { return 1; } else { return 0; } } elseif( $expected_data_type == 'string' ) { if( $secure_level == 1 ) { if( $preg ) { return 0; } else { return 1; } } } } /* * Funkcja z $data usuwa skladnie SQL */ function convert_to_safe_data( $data ) { '%43' => 'C', '%45' => 'E', '%49' => 'I', '%4c' => 'L', '%4e' => 'N', '%4f' => 'O', '%53' => 'S', '%54' => 'T', '%55' => 'U', '%63' => 'c', '%65' => 'e', '%69' => 'i', '%6c' => 'l', '%6e' => 'n', '%6f' => 'o', '%73' => 's', '%74' => 't', '%75' => 'u', '%58' => 'X', '%78' => 'x', '%2a' => '*', '%2f' => '/'); foreach( $hex_translate AS $hex => $char ) { } return $data; }<!--QuoteEnd--></div><!--QuoteEEnd--> prosil bym o ocene, i czy to zmniejszy szanse ataku sql injection? Funkcja druga to sie wzorowalem na tym <!--c1--><div class='codetop'>Kod</div><div class='codemain'><!--ec1-->http://axelpl.wordpress.com/2008/01/01/uniwersalne-zabezpieczenie-przed-sql-injection-i-xss/<!--c2--></div><!--ec2-->
zmniejszy to szanse ataku sql inj jesli bede stosowac te funkcje?