本文整理汇总了PHP中JFilterOutput::linkXHTMLSafe方法的典型用法代码示例。如果您正苦于以下问题:PHP JFilterOutput::linkXHTMLSafe方法的具体用法?PHP JFilterOutput::linkXHTMLSafe怎么用?PHP JFilterOutput::linkXHTMLSafe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JFilterOutput
的用法示例。
在下文中一共展示了JFilterOutput::linkXHTMLSafe方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testLinkXHTMLSafe
/**
* Tests enforcing XHTML links.
*
* @return void
*/
public function testLinkXHTMLSafe()
{
$this->assertEquals(
'<a href="http://www.example.com/index.frd?one=1&two=2&three=3">This & That</a>',
$this->object->linkXHTMLSafe('<a href="http://www.example.com/index.frd?one=1&two=2&three=3">This & That</a>'),
'Should clean ampersands only out of link, not out of link text'
);
}
示例2: filter
function filter($filterme)
{
return JFilterOutput::linkXHTMLSafe($filterme);
}
示例3: _bindData
function _bindData($verbose = true)
{
$option = 'com_rsmembership';
jimport('joomla.mail.helper');
$return = true;
$post = JRequest::get('post');
if (empty($post)) {
return false;
}
$this->_data = new stdClass();
$user =& JFactory::getUser();
$choose_username = RSMembershipHelper::getConfig('choose_username');
if ($choose_username) {
$post['username'] = str_replace('-', '_', JFilterOutput::linkXHTMLSafe(@$post['username']));
if ($user->get('guest')) {
if (empty($post['username']) || strlen($post['username']) < 2) {
if ($verbose) {
JError::raiseWarning(500, JText::_('RSM_PLEASE_TYPE_USERNAME'));
}
$return = false;
}
$this->_db->setQuery("SELECT id FROM #__users WHERE username='" . $this->_db->getEscaped($post['username']) . "'");
if ($this->_db->loadResult()) {
if ($verbose) {
JError::raiseWarning(500, JText::_('RSM_USERNAME_NOT_OK'));
}
$return = false;
}
}
$this->_data->username = $user->get('guest') ? @$post['username'] : $user->get('username');
}
$choose_password = RSMembershipHelper::getConfig('choose_password');
if ($choose_password) {
$password = JRequest::getVar('password', '', 'default', 'none', JREQUEST_ALLOWRAW);
$password2 = JRequest::getVar('password2', '', 'default', 'none', JREQUEST_ALLOWRAW);
if ($user->get('guest')) {
if (!strlen($password)) {
if ($verbose) {
JError::raiseWarning(500, JText::_('RSM_PLEASE_TYPE_PASSWORD'));
}
$return = false;
} elseif (strlen($password) < 6) {
if ($verbose) {
JError::raiseWarning(500, JText::_('RSM_PLEASE_TYPE_PASSWORD_6'));
}
$return = false;
} elseif ($password != $password2) {
if ($verbose) {
JError::raiseWarning(500, JText::_('RSM_PLEASE_CONFIRM_PASSWORD'));
}
$return = false;
}
}
$this->_data->password = $user->get('guest') ? md5($password) : '';
}
if ($user->get('guest') && empty($post['name'])) {
if ($verbose) {
JError::raiseWarning(500, JText::_('RSM_PLEASE_TYPE_NAME'));
}
$return = false;
}
$this->_data->name = $user->get('guest') ? @$post['name'] : $user->get('name');
if ($user->get('guest') && (empty($post['email']) || !JMailHelper::isEmailAddress($post['email']))) {
if ($verbose) {
JError::raiseWarning(500, JText::_('RSM_PLEASE_TYPE_EMAIL'));
}
$return = false;
}
$this->_data->email = $user->get('guest') ? @$post['email'] : $user->get('email');
$db =& JFactory::getDBO();
$db->setQuery("SELECT * FROM #__rsmembership_fields WHERE (required='1' OR `rule` != '') AND published='1' ORDER BY ordering");
$fields = $db->loadObjectList();
foreach ($fields as $field) {
if ($field->required && empty($post['rsm_fields'][$field->name]) || $field->rule && !empty($post['rsm_fields'][$field->name]) && is_callable('RSMembershipValidation', $field->rule) && !call_user_func(array('RSMembershipValidation', $field->rule), @$post['rsm_fields'][$field->name])) {
$validation_message = JText::_($field->validation);
if (empty($validation_message)) {
$validation_message = JText::sprintf('RSM_VALIDATION_DEFAULT_ERROR', JText::_($field->label));
}
if ($verbose) {
JError::raiseWarning(500, $validation_message);
}
$return = false;
}
}
$this->_data->fields = @$post['rsm_fields'];
// coupon
$this->_data->coupon = JRequest::getVar('coupon');
$captcha_enabled = RSMembershipHelper::getConfig('captcha_enabled');
$use_captcha = $this->getUseCaptcha();
if ($use_captcha && $captcha_enabled && $verbose) {
if ($captcha_enabled == 1) {
if (!class_exists('JSecurImage')) {
require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_rsmembership' . DS . 'helpers' . DS . 'securimage' . DS . 'securimage.php';
}
$captcha_image = new JSecurImage();
$valid = $captcha_image->check($post['captcha']);
if (!$valid) {
JError::raiseNotice(500, JText::_('RSM_CAPTCHA_ERROR'));
$return = false;
}
//.........这里部分代码省略.........
示例4: linkXHTMLSafe
/**
* Helper wrapper method for linkXHTMLSafe
*
* @param string $input String to process.
*
* @return string Processed string.
*
* @see JFilterOutput::linkXHTMLSafe()
* @since 3.4
*/
public function linkXHTMLSafe($input)
{
return JFilterOutput::linkXHTMLSafe($input);
}