Exemplo n.º 1
0
 /**
  * Checks whether given value matches any of the supplied
  * filter patterns
  *
  * @access	private
  * @param mixed $key
  * @param mixed $value
  * @return	array
  */
 function Detect($key, $value)
 {
     if (preg_match('/[^\\w\\s\\/]+/ims', $value) && !empty($value)) {
         if (in_array($key, $this->mExceptions, true)) {
             return null;
         }
         $value = IDSConverter::Convert($value);
         $value = get_magic_quotes_gpc() ? stripslashes($value) : $value;
         $key = $this->mScanKeys ? IDSConverter::Convert($key) : $key;
         $filters = array();
         $filterSet = $this->mStorage->FilterSet();
         for ($i = 0; $i < count($filterSet); $i++) {
             $filter =& $filterSet[$i];
             if (is_array($this->mTags)) {
                 if (array_intersect($this->mTags, $filter->Tags())) {
                     if ($this->Match($key, $value, $filter)) {
                         $filters[] =& $filter;
                     }
                 }
             } else {
                 if ($this->Match($key, $value, $filter)) {
                     $filters[] =& $filter;
                 }
             }
         }
         return empty($filters) ? null : $filters;
     }
 }
 /**
  * Constructor
  *
  * @access	public
  * @param string $xmlFile
  * @return	void
  */
 function IDSXmlStorageProvider($xmlFile)
 {
     parent::IDSStorageProvider();
     $this->mXmlFile = $xmlFile;
 }