stripslashes() static public method

A better way to strip slashes
static public stripslashes ( string $string ) : string
$string string
return string
Ejemplo n.º 1
0
 /**
  * Sanitizes the incoming data
  * 
  * @param  array $data
  * @return array
  */
 static function sanitize($data)
 {
     foreach ($data as $key => $value) {
         if (!is_array($value)) {
             $value = trim(str::stripslashes($value));
         } else {
             $value = self::sanitize($value);
         }
         $data[$key] = $value;
     }
     return $data;
 }
Ejemplo n.º 2
0
 function get($key = false, $default = null)
 {
     if (empty($key)) {
         return $_REQUEST;
     }
     $value = a::get($_REQUEST, $key, $default);
     return !is_array($value) ? trim(str::stripslashes($value)) : $value;
 }
Ejemplo n.º 3
0
Archivo: r.php Proyecto: chrishiam/LVSL
 /**
  * Private method to sanitize incoming request data
  *
  * @param array $data
  * @return array
  */
 protected static function sanitize($data)
 {
     if (!is_array($data)) {
         return trim(str::stripslashes($data));
     }
     foreach ($data as $key => $value) {
         $data[$key] = static::sanitize($value);
     }
     return $data;
 }
Ejemplo n.º 4
0
 function get($key = false, $default = null)
 {
     $request = self::method() == 'GET' ? $_REQUEST : array_merge($_REQUEST, self::body());
     if (empty($key)) {
         return $request;
     }
     $value = a::get($request, $key, $default);
     return !is_array($value) ? trim(str::stripslashes($value)) : $value;
 }