• Web sitemizin içeriğine ve tüm hizmetlerimize erişim sağlamak için Web sitemize kayıt olmalı ya da giriş yapmalısınız. Web sitemize üye olmak tamamen ücretsizdir.
  • Sohbetokey.com ile canlı okey oynamaya ne dersin? Hem sohbet et, hem mobil okey oyna!
  • Soru mu? Sorun mu? ''Bir Sorum Var?'' sistemimiz aktiftir. Paylaşın beraber çözüm üretelim.

PHP XSS Açığı İçin Uygulanabilecek Fonksiyon

The Punisher

MFC Üyesi
Üyelik Tarihi
6 Haz 2015
Konular
785
Mesajlar
930
MFC Puanı
230
PHP:
function G_filter($text) {

 

   if ( is_array($text) ) {

    

      $text = array_map('G_filter', $text);

       

   } else {

       

      if ( get_magic_quotes_gpc() ) {

       

         $text = htmlspecialchars(stripcslashes(trim($text)),ENT_QUOTES);

          

      } else {

       

         $text = htmlspecialchars(trim($text),ENT_QUOTES);

          

      }

       

   }

 

   return $text;

    

}

 

$_GET = array_map('G_filter',$_GET);

$_POST = array_map('G_filter',$_POST);

$_COOKIE = array_map('G_filter',$_COOKIE);
 
Üst