本文整理汇总了PHP中JRequest::clean方法的典型用法代码示例。如果您正苦于以下问题:PHP JRequest::clean方法的具体用法?PHP JRequest::clean怎么用?PHP JRequest::clean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JRequest
的用法示例。
在下文中一共展示了JRequest::clean方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defined
// no direct access
defined('_JEXEC') or die('Restricted access');
/**
* Load the loader class
*/
if (!class_exists('JLoader')) {
require_once JPATH_LIBRARIES . DS . 'loader.php';
}
/**
* Joomla! library imports
*/
//Base classes
JLoader::import('joomla.base.object');
//Environment classes
JLoader::import('joomla.environment.request');
JRequest::clean();
JLoader::import('joomla.environment.response');
//Factory class and methods
JLoader::import('joomla.factory');
JLoader::import('joomla.version');
if (!defined('JVERSION')) {
$version = new JVersion();
define('JVERSION', $version->getShortVersion());
}
//Error
JLoader::import('joomla.error.error');
JLoader::import('joomla.error.exception');
//Utilities
JLoader::import('joomla.utilities.arrayhelper');
//Filters
JLoader::import('joomla.filter.filterinput');
示例2: testRequestCleanWithNumericString
function testRequestCleanWithNumericString()
{
$this->markTestIncomplete('This test needs work.');
try {
$passed = false;
$_POST['0'] = 'This is invalid.';
/*
* Call the clean method.
*/
JRequest::clean();
} catch (Exception $e) {
$passed = true;
}
if (! $passed) {
$this -> fail('JRequest::clean() didn\'t die on a banned variable.');
}
}