Ejemplo n.º 1
0
 /**
  * @param mixed $mValue
  * @param bool $bClearNullBite = false
  *
  * @return mixed
  */
 public static function StripSlashesValue($mValue, $bClearNullBite = false)
 {
     static $bIsMagicQuotesOn = null;
     if (null === $bIsMagicQuotesOn) {
         $bIsMagicQuotesOn = (bool) @\ini_get('magic_quotes_gpc');
     }
     if (!$bIsMagicQuotesOn) {
         return $bClearNullBite && \is_string($mValue) ? \MailSo\Base\Utils::ClearNullBite($mValue) : $mValue;
     }
     $sType = \gettype($mValue);
     if ('string' === $sType) {
         return \stripslashes($bClearNullBite ? \MailSo\Base\Utils::ClearNullBite($mValue) : $mValue);
     } else {
         if ('array' === $sType) {
             $aReturnValue = array();
             $mValueKeys = \array_keys($mValue);
             foreach ($mValueKeys as $sKey) {
                 $aReturnValue[$sKey] = \MailSo\Base\Utils::StripSlashesValue($mValue[$sKey], $bClearNullBite);
             }
             return $aReturnValue;
         }
     }
     return $mValue;
 }
Ejemplo n.º 2
0
 /**
  * @param string $sKey
  * @param mixed $mDefault = null
  *
  * @return mixed
  */
 public function GetRequest($sKey, $mDefault = null)
 {
     return isset($_REQUEST[$sKey]) ? \MailSo\Base\Utils::StripSlashesValue($_REQUEST[$sKey]) : $mDefault;
 }