// Handle the type constraint switch (strtoupper($type)) { case 'INT' : case 'INTEGER' : // Only use the first integer value preg_match('/-?[0-9]+/', (string) $source, $matches); $result = @ (int) $matches[0]; break; case 'FLOAT' : case 'DOUBLE' : // Only use the first floating point value preg_match('/-?[0-9]+(\.[0-9]+)?/', (string) $source, $matches); $result = @ (float) $matches[0]; break; case 'BOOL' : case 'BOOLEAN' : $result = (bool) $source; break; case 'WORD' : $result = (string) preg_replace( '/[^A-Z_]/i', '', $source ); break; case 'ALNUM' : $result = (string) preg_replace( '/[^A-Z0-9]/i', '', $source ); break; case 'CMD' : $result = (string) preg_replace( '/[^A-Z0-9_\.-]/i', '', $source ); $result = ltrim($result, '.'); break; case 'BASE64' : $result = (string) preg_replace( '/[^A-Z0-9\/+=]/i', '', $source ); break; case 'STRING' : // Check for static usage and assign $filter the proper variable if(isset($this) && is_a( $this, 'JFilterInput' )) { $filter =& $this; } else { $filter =& JFilterInput::getInstance(); } $result = (string) $filter->_remove($filter->_decode((string) $source)); break; case 'ARRAY' : $result = (array) $source; break; case 'PATH' : $pattern = '/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/'; preg_match($pattern, (string) $source, $matches); $result = @ (string) $matches[0]; break; case 'USERNAME' : $result = (string) preg_replace( '/[\x00-\x1F\x7F<>"\'%&]/', '', $source ); break; case 'MENUTYPE': $result = str_replace('-', ' ', $source); $lang = &JFactory::getLanguage(); $result = $lang->transliterate($result); $result = (string) preg_replace( array('/\s+/','/[^A-Za-z0-9\-\_]/'), array('-',''), $result ); $result = strtolower(trim($result)); break; default : // Check for static usage and assign $filter the proper variable if(is_object($this) && get_class($this) == 'JFilterInput') { $filter =& $this; } else { $filter =& JFilterInput::getInstance(); } // Are we dealing with an array? if (is_array($source)) { foreach ($source as $key => $value) { // filter element for XSS and other 'bad' code etc. if (is_string($value)) { $source[$key] = $filter->_remove($filter->_decode($value)); } } $result = $source; } else { // Or a string? if (is_string($source) && !empty ($source)) { // filter source for XSS and other 'bad' code etc. $result = $filter->_remove($filter->_decode($source)); } else { // Not an array or string.. return the passed parameter $result = $source; } } break; } return $result; } /** * Function to determine if contents of an attribute is safe * * @static * @param array $attrSubSet A 2 element array for attributes name,value * @return boolean True if bad code is detected * @since 1.5 */ function checkAttribute($attrSubSet) { $attrSubSet[0] = strtolower($attrSubSet[0]); $attrSubSet[1] = strtolower($attrSubSet[1]); return (((strpos($attrSubSet[1], 'expression') !== false) && ($attrSubSet[0]) == 'style') || (strpos($attrSubSet[1], 'javascript:') !== false) || (strpos($attrSubSet[1], 'behaviour:') !== false) || (strpos($attrSubSet[1], 'vbscript:') !== false) || (strpos($attrSubSet[1], 'mocha:') !== false) || (strpos($attrSubSet[1], 'livescript:') !== false)); } /** * Internal method to iteratively remove all unwanted tags and attributes * * @access protected * @param string $source Input string to be 'cleaned' * @return string 'Cleaned' version of input parameter * @since 1.5 */ function _remove($source) { $loopCounter = 0; // Iteration provides nested tag protection while ($source != $this->_cleanTags($source)) { $source = $this->_cleanTags($source); $loopCounter ++; } return $source; } /** * Internal method to
Fatal error: Class 'JFilterInput' not found in /home/alfydog/public_html/monktet.com/libraries/joomla/session/storage.php on line 57