• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP JFilterInput类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中JFilterInput的典型用法代码示例。如果您正苦于以下问题:PHP JFilterInput类的具体用法?PHP JFilterInput怎么用?PHP JFilterInput使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了JFilterInput类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->app = JFactory::getApplication();
     // Get project id.
     $this->projectId = $this->input->getUint('pid');
     // Prepare log object
     $registry = Joomla\Registry\Registry::getInstance('com_crowdfunding');
     /** @var  $registry Joomla\Registry\Registry */
     $fileName = $registry->get('logger.file');
     $tableName = $registry->get('logger.table');
     $file = JPath::clean($this->app->get('log_path') . DIRECTORY_SEPARATOR . $fileName);
     $this->log = new Prism\Log\Log();
     $this->log->addAdapter(new Prism\Log\Adapter\Database(JFactory::getDbo(), $tableName));
     $this->log->addAdapter(new Prism\Log\Adapter\File($file));
     // Create an object that contains a data used during the payment process.
     $this->paymentProcessContext = Crowdfunding\Constants::PAYMENT_SESSION_CONTEXT . $this->projectId;
     $this->paymentProcess = $this->app->getUserState($this->paymentProcessContext);
     // Prepare context
     $filter = new JFilterInput();
     $paymentService = JString::trim(JString::strtolower($this->input->getCmd('payment_service')));
     $paymentService = $filter->clean($paymentService, 'ALNUM');
     $this->context = JString::strlen($paymentService) > 0 ? 'com_crowdfunding.notify.' . $paymentService : 'com_crowdfunding.notify';
     // Prepare params
     $this->params = JComponentHelper::getParams('com_crowdfunding');
 }
开发者ID:bellodox,项目名称:CrowdFunding,代码行数:26,代码来源:notifier.raw.php


示例2: __construct

 public function __construct($config = array())
 {
     parent::__construct($config);
     $this->app = JFactory::getApplication();
     // Get project ID.
     $this->projectId = $this->input->getUint('pid');
     // Prepare log object.
     $this->log = new Prism\Log\Log();
     // Set database log adapter if Joomla! debug is enabled.
     if ($this->logTable !== null and $this->logTable !== '' and JDEBUG) {
         $this->log->addAdapter(new Prism\Log\Adapter\Database(\JFactory::getDbo(), $this->logTable));
     }
     // Set file log adapter.
     if ($this->logFile !== null and $this->logFile !== '') {
         $file = \JPath::clean($this->app->get('log_path') . DIRECTORY_SEPARATOR . basename($this->logFile));
         $this->log->addAdapter(new Prism\Log\Adapter\File($file));
     }
     // Prepare context
     $filter = new JFilterInput();
     $paymentService = $filter->clean(trim(strtolower($this->input->getCmd('payment_service'))), 'ALNUM');
     $this->context = Joomla\String\StringHelper::strlen($paymentService) > 0 ? 'com_crowdfunding.notify.' . $paymentService : 'com_crowdfunding.notify';
     // Prepare params
     $this->params = JComponentHelper::getParams('com_crowdfunding');
     // Prepare container and some of the most used objects.
     $this->container = Prism\Container::getContainer();
     $this->prepareCurrency($this->container, $this->params);
     $this->prepareMoneyFormatter($this->container, $this->params);
 }
开发者ID:ITPrism,项目名称:CrowdfundingDistribution,代码行数:28,代码来源:notifier.raw.php


示例3: __construct

 public function __construct($config = array())
 {
     parent::__construct($config);
     $app = JFactory::getApplication();
     /** @var $app JApplicationSite */
     // Get project id.
     $this->projectId = $this->input->getUint("pid");
     // Prepare log object
     $registry = JRegistry::getInstance("com_crowdfunding");
     /** @var  $registry Joomla\Registry\Registry */
     $fileName = $registry->get("logger.file");
     $tableName = $registry->get("logger.table");
     $file = JPath::clean(JFactory::getApplication()->get("log_path") . DIRECTORY_SEPARATOR . $fileName);
     $this->log = new ITPrismLog();
     $this->log->addWriter(new ITPrismLogWriterDatabase(JFactory::getDbo(), $tableName));
     $this->log->addWriter(new ITPrismLogWriterFile($file));
     // Create an object that contains a data used during the payment process.
     $this->paymentProcessContext = CrowdFundingConstants::PAYMENT_SESSION_CONTEXT . $this->projectId;
     $this->paymentProcess = $app->getUserState($this->paymentProcessContext);
     // Prepare context
     $filter = new JFilterInput();
     $paymentService = JString::trim(JString::strtolower($this->input->getCmd("payment_service")));
     $paymentService = $filter->clean($paymentService, "ALNUM");
     $this->context = !empty($paymentService) ? 'com_crowdfunding.notify.' . $paymentService : 'com_crowdfunding.notify';
     // Prepare params
     $this->params = JComponentHelper::getParams("com_crowdfunding");
 }
开发者ID:phpsource,项目名称:CrowdFunding,代码行数:27,代码来源:notifier.raw.php


示例4: _getSearchData

 protected function _getSearchData()
 {
     // clean html tags
     $filter = new JFilterInput();
     $value = $filter->clean($this->_data->get('value', ''));
     return empty($value) ? null : $value;
 }
开发者ID:bizanto,项目名称:Hooked,代码行数:7,代码来源:textarea.php


示例5: saveContentPrep

 function saveContentPrep(&$row)
 {
     // Get submitted text from the request variables
     $text = JRequest::getVar('text', '', 'post', 'string', JREQUEST_ALLOWRAW);
     // Clean text for xhtml transitional compliance
     $text = str_replace('<br>', '<br />', $text);
     // Search for the {readmore} tag and split the text up accordingly.
     $pattern = '#<hr\\s+id=("|\')system-readmore("|\')\\s*\\/*>#i';
     $tagPos = preg_match($pattern, $text);
     if ($tagPos == 0) {
         $row->introtext = $text;
     } else {
         list($row->introtext, $row->fulltext) = preg_split($pattern, $text, 2);
     }
     // Filter settings
     jimport('joomla.application.component.helper');
     $config = JComponentHelper::getParams('com_content');
     $user =& JFactory::getUser();
     $gid = $user->get('gid');
     $filterGroups = $config->get('filter_groups');
     // convert to array if one group selected
     if (!is_array($filterGroups) && (int) $filterGroups > 0) {
         $filterGroups = array($filterGroups);
     }
     if (is_array($filterGroups) && in_array($gid, $filterGroups)) {
         $filterType = $config->get('filter_type');
         $filterTags = preg_split('#[,\\s]+#', trim($config->get('filter_tags')));
         $filterAttrs = preg_split('#[,\\s]+#', trim($config->get('filter_attritbutes')));
         switch ($filterType) {
             case 'NH':
                 $filter = new JFilterInput();
                 break;
             case 'WL':
                 $filter = new JFilterInput($filterTags, $filterAttrs, 0, 0, 0);
                 // turn off xss auto clean
                 break;
             case 'BL':
             default:
                 $filter = new JFilterInput($filterTags, $filterAttrs, 1, 1);
                 break;
         }
         $row->introtext = $filter->clean($row->introtext);
         $row->fulltext = $filter->clean($row->fulltext);
     } elseif (empty($filterGroups) && $gid != '25') {
         // no default filtering for super admin (gid=25)
         $filter = new JFilterInput(array(), array(), 1, 1);
         $row->introtext = $filter->clean($row->introtext);
         $row->fulltext = $filter->clean($row->fulltext);
     }
     return true;
 }
开发者ID:jicheng17,项目名称:comanova,代码行数:51,代码来源:helper.php


示例6: notify

 /**
  * Catch the response from PayPal and store data about transaction/
  *
  * @todo Move sending mail functionality to plugins.
  */
 public function notify()
 {
     $app = JFactory::getApplication();
     /** @var $app JApplicationSite * */
     $params = $app->getParams("com_virtualcurrency");
     // Check for disabled payment functionality
     if ($params->get("debug_payment_disabled", 0)) {
         $error = JText::_("COM_VIRTUALCURRENCY_ERROR_PAYMENT_HAS_BEEN_DISABLED");
         $error .= "\n" . JText::sprintf("COM_VIRTUALCURRENCY_TRANSACTION_DATA", var_export($_POST, true));
         JLog::add($error);
         return null;
     }
     // Clear the name of the payment gateway.
     $filter = new JFilterInput();
     $paymentService = $filter->clean(JString::trim(JString::strtolower($this->input->getCmd("payment_service"))));
     $context = !empty($paymentService) ? 'com_virtualcurrency.notify.' . $paymentService : 'com_crowdfunding.notify';
     // Save data
     try {
         // Events
         $dispatcher = JEventDispatcher::getInstance();
         // Event Notify
         JPluginHelper::importPlugin('virtualcurrencypayment');
         $results = $dispatcher->trigger('onPaymenNotify', array($context, &$params));
         $transaction = null;
         $currency = null;
         if (!empty($results)) {
             foreach ($results as $result) {
                 if (!empty($result) and isset($result["transaction"])) {
                     $transaction = JArrayHelper::getValue($result, "transaction");
                     $currency = JArrayHelper::getValue($result, "currency");
                     break;
                 }
             }
         }
         // If there is no transaction data, the status might be pending or another one.
         // So, we have to stop the script execution.
         if (empty($transaction)) {
             return;
         }
         // Event After Payment
         $dispatcher->trigger('onAfterPayment', array($context, &$transaction, &$params, &$currency));
     } catch (Exception $e) {
         JLog::add($e->getMessage());
         $input = "INPUT:" . var_export($app->input, true) . "\n";
         JLog::add($input);
         // Send notification about the error to the administrator.
         $model = $this->getModel();
         $model->sendMailToAdministrator();
     }
 }
开发者ID:bellodox,项目名称:VirtualCurrency,代码行数:55,代码来源:notifier.raw.php


示例7: getInstance

 /**
  * Get specific SMS gateway instance
  *
  * @return  object  gateway
  */
 private function getInstance()
 {
     if (!isset($this->gateway)) {
         $params = $this->getParams();
         $gateway = $params->get('sms-gateway', 'kapow.php');
         $input = new JFilterInput();
         $gateway = $input->clean($gateway, 'CMD');
         require_once JPATH_ROOT . '/components/com_fabrik/helpers/sms_gateways/' . JString::strtolower($gateway);
         $gateway = JFile::stripExt($gateway);
         $this->gateway = new $gateway();
         $this->gateway->params = $params;
     }
     return $this->gateway;
 }
开发者ID:jfquestiaux,项目名称:fabrik,代码行数:19,代码来源:sms.php


示例8: safeAlias

 /**
  * Prepare safe profile alias.
  *
  * @param string $alias
  * @param int $userId
  *
  * @return string
  */
 public static function safeAlias($alias, $userId = 0)
 {
     $filter = new \JFilterInput();
     $alias = \JString::strtolower($filter->clean($alias, 'ALNUM'));
     // Check for valid alias.
     $aliasValidator = new Validator\Profile\Alias(\JFactory::getDbo(), $alias, $userId);
     if (!$aliasValidator->isValid()) {
         if (!$alias) {
             $alias = StringHelper::generateRandomString(16);
         } else {
             $alias .= mt_rand(10, 1000);
         }
     }
     return $alias;
 }
开发者ID:ITPrism,项目名称:SocialCommunityDistribution,代码行数:23,代码来源:Helper.php


示例9: requestSent

 function requestSent()
 {
     $jfbcRequestId = JRequest::getInt('jfbcId');
     $fbRequestId = JRequest::getString('requestId');
     $inToList = JRequest::getVar('to');
     // Get the from user id from the request
     $to = $inToList[0];
     $requestInfo = JFBCFactory::provider('facebook')->api('/' . $fbRequestId . "_" . $to);
     $fbFrom = $requestInfo['from']['id'];
     // Not using the model, as we're doing a simple store.
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_jfbconnect/tables');
     $data = array();
     $data['fb_request_id'] = $fbRequestId;
     $data['fb_user_from'] = $fbFrom;
     $data['jfbc_request_id'] = $jfbcRequestId;
     $data['created'] = JFactory::getDate()->toSql();
     $data['modified'] = null;
     //        $data['destination_url'] = JRequest::getString('destinationUrl');
     foreach ($inToList as $fbTo) {
         $row =& JTable::getInstance('JFBConnectNotification', 'Table');
         $to = JFilterInput::clean($fbTo, 'ALNUM');
         $data['fb_user_to'] = $to;
         $row->save($data);
         $point = new JFBConnectPoint();
         $point->set('name', 'facebook.request.create');
         $point->set('key', $to);
         $point->award();
     }
     $app = JFactory::getApplication();
     $app->close();
 }
开发者ID:q0821,项目名称:esportshop,代码行数:31,代码来源:request.php


示例10: _loadEditor

 /**
  * Load the editor
  *
  * @access	private
  * @param	array	Associative array of editor config paramaters
  * @since	1.5
  */
 function _loadEditor($config = array())
 {
     //check if editor is already loaded
     if (!is_null($this->_editor)) {
         return;
     }
     jimport('joomla.filesystem.file');
     // Build the path to the needed editor plugin
     $name = JFilterInput::clean($this->_name, 'cmd');
     $path = JPATH_SITE . DS . 'plugins' . DS . 'editors' . DS . $name . '.php';
     if (!JFile::exists($path)) {
         $message = JText::_('Cannot load the editor');
         JCKHelper::error($message);
         return false;
     }
     // Require plugin file
     require_once $path;
     // Build editor plugin classname
     $name = 'plgEditor' . $this->_name;
     if ($this->_editor = new $name($this, $config)) {
         // load plugin parameters
         $this->initialise();
         JPluginHelper::importPlugin('editors-xtd');
     }
 }
开发者ID:scarsroga,项目名称:blog-soa,代码行数:32,代码来源:editor.php


示例11: expression

 public static function expression($calculation, $formId)
 {
     $return = '';
     $pattern = '#{(.*?):value}#is';
     $expression = $calculation->expression;
     $filter = JFilterInput::getInstance();
     preg_match_all($pattern, $calculation->expression, $matches);
     if ($matches) {
         foreach ($matches[0] as $i => $match) {
             $field = $filter->clean($matches[1][$i] . "_" . $formId, 'cmd');
             $return .= "\t total" . $field . " = 0;\n";
             $return .= "\t values" . $field . " = rsfp_getValue(" . $formId . ", '" . $matches[1][$i] . "');\n";
             $return .= "\t if (typeof values" . $field . " == 'object') { \n";
             $return .= "\t\t for(i=0;i<values" . $field . ".length;i++) {\n";
             $return .= "\t\t\t thevalue = values" . $field . "[i]; \n";
             $return .= "\t\t\t if (isset(RSFormProPrices['" . $formId . "_" . $matches[1][$i] . "'])) { \n";
             $return .= "\t\t\t\t total" . $field . " += isset(RSFormProPrices['" . $formId . "_" . $matches[1][$i] . "'][thevalue]) ? parseFloat(RSFormProPrices['" . $formId . "_" . $matches[1][$i] . "'][thevalue]) : 0; \n";
             $return .= "\t\t\t }\n";
             $return .= "\t\t }\n";
             $return .= "\t } else { \n";
             $return .= "\t\t total" . $field . " += (values" . $field . ".indexOf(',') == -1 && values" . $field . ".indexOf('.') == -1) ? parseFloat(values" . $field . ") :  parseFloat(rsfp_toNumber(values" . $field . ",'" . self::escape(RSFormProHelper::getConfig('calculations.decimal')) . "','" . self::escape(RSFormProHelper::getConfig('calculations.thousands')) . "')); \n";
             $return .= "\t } \n";
             $return .= "\t total" . $field . " = !isNaN(total" . $field . ") ? total" . $field . " : 0; \n\n";
             $expression = str_replace($match, 'total' . $field, $expression);
         }
         $return .= "\n\t grandTotal" . $calculation->id . $formId . " = " . $expression . ";\n";
         $return .= "\t document.getElementById('" . $calculation->total . "').value = number_format(grandTotal" . $calculation->id . $formId . "," . (int) RSFormProHelper::getConfig('calculations.nodecimals') . ",'" . self::escape(RSFormProHelper::getConfig('calculations.decimal')) . "','" . self::escape(RSFormProHelper::getConfig('calculations.thousands')) . "'); \n\n";
     }
     return $return;
 }
开发者ID:knigherrant,项目名称:decopatio,代码行数:30,代码来源:calculations.php


示例12: getInstance

 /**
  * Returns a Controller object, always creating it
  *
  * @param   string $type   The contlorer type to instantiate
  * @param   string $prefix Prefix for the controller class name. Optional.
  * @param   array  $config Configuration array for controller. Optional.
  *
  * @return  mixed   A model object or false on failure
  *
  * @since       1.1.0
  */
 public static function getInstance($type, $prefix = '', $config = array())
 {
     // Check for array format.
     $filter = JFilterInput::getInstance();
     $type = $filter->clean($type, 'cmd');
     $prefix = $filter->clean($prefix, 'cmd');
     $controllerClass = $prefix . ucfirst($type);
     if (!class_exists($controllerClass)) {
         if (!isset(self::$paths[$controllerClass])) {
             // Get the environment configuration.
             $basePath = JArrayHelper::getValue($config, 'base_path', JPATH_COMPONENT);
             $nameConfig = empty($type) ? array('name' => 'controller') : array('name' => $type, 'format' => JFactory::getApplication()->input->get('format', '', 'word'));
             // Define the controller path.
             $paths[] = $basePath . '/controllers';
             $paths[] = $basePath;
             $path = JPath::find($paths, self::createFileName($nameConfig));
             self::$paths[$controllerClass] = $path;
             // If the controller file path exists, include it.
             if ($path) {
                 require_once $path;
             }
         }
         if (!class_exists($controllerClass)) {
             JLog::add(JText::sprintf('JLIB_APPLICATION_ERROR_INVALID_CONTROLLER', $controllerClass), JLog::WARNING, 'kextensions');
             return false;
         }
     }
     return new $controllerClass($config);
 }
开发者ID:fields-and-filters,项目名称:fields-and-filters,代码行数:40,代码来源:controller.php


示例13: saveForm

 function saveForm()
 {
     $entry = new stdClass();
     $entry->entry_id = hikashop_getCID('entry_id');
     $formData = JRequest::getVar('data', array(), '', 'array');
     jimport('joomla.filter.filterinput');
     $safeHtmlFilter =& JFilterInput::getInstance(null, null, 1, 1);
     foreach ($formData['entry'] as $column => $value) {
         hikashop_secureField($column);
         $entry->{$column} = $safeHtmlFilter->clean($value, 'string');
     }
     $status = $this->save($entry);
     if (JRequest::getVar('tmpl', '') == 'component') {
         if ($status) {
             $url = hikashop_completeLink('order&task=edit&cid=' . $entry->order_id, false, true);
             echo '<html><head><script type="text/javascript">parent.window.location.href=\'' . $url . '\';</script></head><body></body></html>';
             exit;
         } else {
             $app = JFactory::getApplication();
             if (version_compare(JVERSION, '1.6', '<')) {
                 $session =& JFactory::getSession();
                 $session->set('application.queue', $app->_messageQueue);
             }
             echo '<html><head><script type="text/javascript">javascript: history.go(-1);</script></head><body></body></html>';
             exit;
         }
     }
     return $status;
 }
开发者ID:q0821,项目名称:esportshop,代码行数:29,代码来源:entry.php


示例14: getInstance

 /**
  * Returns a session storage handler object, only creating it if it doesn't already exist.
  *
  * @param   string  $name     The session store to instantiate
  * @param   array   $options  Array of options
  *
  * @return  JSessionStorage
  *
  * @since   11.1
  */
 public static function getInstance($name = 'none', $options = array())
 {
     $name = strtolower(JFilterInput::getInstance()->clean($name, 'word'));
     if (empty(self::$instances[$name])) {
         /** @var JSessionStorage $class */
         $class = 'JSessionStorage' . ucfirst($name);
         if (!class_exists($class)) {
             $path = __DIR__ . '/storage/' . $name . '.php';
             if (!file_exists($path)) {
                 // No attempt to die gracefully here, as it tries to close the non-existing session
                 jexit('Unable to load session storage class: ' . $name);
             }
             require_once $path;
             // The class should now be loaded
             if (!class_exists($class)) {
                 // No attempt to die gracefully here, as it tries to close the non-existing session
                 jexit('Unable to load session storage class: ' . $name);
             }
         }
         // Validate the session storage is supported on this platform
         if (!$class::isSupported()) {
             // No attempt to die gracefully here, as it tries to close the non-existing session
             jexit(sprintf('The %s Session Storage is not supported on this platform.', $name));
         }
         self::$instances[$name] = new $class($options);
     }
     return self::$instances[$name];
 }
开发者ID:adjaika,项目名称:J3Base,代码行数:38,代码来源:storage.php


示例15: testGetVarFromDataSet

 /**
  * @dataProvider getVarData
  * @covers JRequest::getVar
  * @covers JRequest::_cleanVar
  * @covers JRequest::_stripSlashesRecursive
  */
 public function testGetVarFromDataSet($name, $default, $hash, $type, $mask, $expect, $filterCalls)
 {
     jimport('joomla.environment.request');
     $filter = JFilterInput::getInstance();
     $filter->mockReset();
     if (count($filterCalls)) {
         foreach ($filterCalls as $info) {
             $filter->mockSetUp($info[0], $info[1], $info[2], $info[3]);
         }
     }
     /*
      * Get the variable and check the value.
      */
     $actual = JRequest::getVar($name, $default, $hash, $type, $mask);
     $this->assertEquals($expect, $actual, 'Non-cached getVar');
     /*
      * Repeat the process to check caching (the JFilterInput mock should not
      * get called unless the default is being used).
      */
     $actual = JRequest::getVar($name, $default, $hash, $type, $mask);
     $this->assertEquals($expect, $actual, 'Cached getVar');
     if (($filterOK = $filter->mockTearDown()) !== true) {
         $this->fail('JFilterInput not called as expected:' . print_r($filterOK, true));
     }
 }
开发者ID:rvsjoen,项目名称:joomla-platform,代码行数:31,代码来源:JRequestGetVarTest.php


示例16: sendMail

 /**
  * Send email whith user data from form
  *
  * @param   array  $params An object containing the module parameters
  *
  * @access public
  */
 public static function sendMail($params)
 {
     $sender = $params->get('sender');
     $recipient = $params->get('recipient');
     $subject = $params->get('subject');
     // Getting the site name
     $sitename = JFactory::getApplication()->get('sitename');
     // Getting user form data-------------------------------------------------
     $name = JFilterInput::getInstance()->clean(JRequest::getVar('name'));
     $phone = JFilterInput::getInstance()->clean(JRequest::getVar('phone'));
     $email = JFilterInput::getInstance()->clean(JRequest::getVar('email'));
     $message = JFilterInput::getInstance()->clean(JRequest::getVar('message'));
     // Set the massage body vars
     $nameLabel = JText::_('MOD_JCALLBACK_FORM_NAME_LABEL_VALUE');
     $phoneLabel = JText::_('MOD_JCALLBACK_FORM_PHONE_LABEL_VALUE');
     $emailLabel = JText::_('MOD_JCALLBACK_FORM_EMAIL_LABEL_VALUE');
     $messageLabel = JText::_('MOD_JCALLBACK_FORM_MESSAGE_LABEL_VALUE');
     $emailLabel = $email ? "<b>{$emailLabel}:</b> {$email}" : "";
     $messageLabel = $message ? "<b>{$messageLabel}:</b> {$message}" : "";
     // Get the JMail ogject
     $mailer = JFactory::getMailer();
     // Set JMail object params------------------------------------------------
     $mailer->setSubject($subject);
     $params->get('useSiteMailfrom') ? $mailer->setSender(JFactory::getConfig()->get('mailfrom')) : $mailer->setSender($sender);
     $mailer->addRecipient($recipient);
     // Get the mail message body
     require JModuleHelper::getLayoutPath('mod_jcallback', 'default_email_message');
     $mailer->isHTML(true);
     $mailer->Encoding = 'base64';
     $mailer->setBody($body);
     $mailer->Send();
     // The mail sending errors will be shown in the Joomla Warning Message from JMail object..
 }
开发者ID:WhiskeyMan-Tau,项目名称:JCallback,代码行数:40,代码来源:helper.php


示例17: _endElement

 /**
  * Character Parser Function
  *
  * @param   object  $parser  Parser object.
  * @param   object  $name    The name of the element.
  *
  * @return  void
  *
  * @since   11.1
  */
 protected function _endElement($parser, $name)
 {
     array_pop($this->stack);
     // @todo remove code: echo 'Closing: '. $name .'<br />';
     switch ($name) {
         case 'UPDATE':
             $ver = new JVersion();
             // Lower case and remove the exclamation mark
             $product = strtolower(JFilterInput::getInstance()->clean($ver->PRODUCT, 'cmd'));
             // Check that the product matches and that the version matches (optionally a regexp)
             if ($product == $this->current_update->targetplatform['NAME'] && preg_match('/' . $this->current_update->targetplatform['VERSION'] . '/', $ver->RELEASE)) {
                 // Target platform isn't a valid field in the update table so unset it to prevent J! from trying to store it
                 unset($this->current_update->targetplatform);
                 if (isset($this->latest)) {
                     if (version_compare($this->current_update->version, $this->latest->version, '>') == 1) {
                         $this->latest = $this->current_update;
                     }
                 } else {
                     $this->latest = $this->current_update;
                 }
             }
             break;
         case 'UPDATES':
             // :D
             break;
     }
 }
开发者ID:Alibek,项目名称:joomla-platform-namespace-example,代码行数:37,代码来源:extension.php


示例18: getStart

 /**
  * Here starts the processing
  *
  * @copyright
  * @author 		RolandD
  * @todo
  * @see
  * @access 		public
  * @param
  * @return
  * @since 		3.0
  */
 public function getStart()
 {
     $jinput = JFactory::getApplication()->input;
     // Load the data
     $this->loadData();
     // Load the helper
     $this->helper = new Com_VirtueMart();
     // Get the logger
     $csvilog = $jinput->get('csvilog', null, null);
     $this->virtuemart_vendor_id = $this->helper->getVendorId();
     // Process data
     foreach ($this->csvi_data as $name => $value) {
         // Check if the field needs extra treatment
         switch ($name) {
             case 'name':
                 $this->{$name} = strtolower(JFilterInput::clean($value, 'alnum'));
                 break;
             default:
                 $this->{$name} = $value;
                 break;
         }
     }
     // Check if we have a field ID
     if (empty($this->virtuemart_userfield_id)) {
         $this->_getFieldId();
     }
     // All is good
     return true;
 }
开发者ID:srbsnkr,项目名称:sellingonlinemadesimple,代码行数:41,代码来源:shopperfieldimport.php


示例19: buildQuery

 /**
  * Query
  */
 function buildQuery()
 {
     $app = JFactory::getApplication();
     $jemsettings = JemHelper::config();
     $filter_order = $app->getUserStateFromRequest('com_jem.userelement.filter_order', 'filter_order', 'u.name', 'cmd');
     $filter_order_Dir = $app->getUserStateFromRequest('com_jem.userelement.filter_order_Dir', 'filter_order_Dir', '', 'word');
     $filter_order = JFilterInput::getInstance()->clean($filter_order, 'cmd');
     $filter_order_Dir = JFilterInput::getInstance()->clean($filter_order_Dir, 'word');
     $search = $app->getUserStateFromRequest('com_jem.userelement.filter_search', 'filter_search', '', 'string');
     $search = $this->_db->escape(trim(JString::strtolower($search)));
     // start query
     $db = JFactory::getDBO();
     $query = $db->getQuery(true);
     $query->select(array('u.id', 'u.name', 'u.username', 'u.email'));
     $query->from('#__users as u');
     // where
     $where = array();
     $where[] = 'u.block = 0';
     /*
      * Search name
      **/
     if ($search) {
         $where[] = ' LOWER(u.name) LIKE \'%' . $search . '%\' ';
     }
     $query->where($where);
     // ordering
     $orderby = '';
     $orderby = $filter_order . ' ' . $filter_order_Dir;
     $query->order($orderby);
     return $query;
 }
开发者ID:JKoelman,项目名称:JEM-3,代码行数:34,代码来源:userelement.php


示例20: saveOne

 public function saveOne($metakey, $value)
 {
     $db = JFactory::getDbo();
     $config = J2Store::config();
     $query = 'REPLACE INTO #__j2store_configurations (config_meta_key,config_meta_value) VALUES ';
     jimport('joomla.filter.filterinput');
     $filter = JFilterInput::getInstance(null, null, 1, 1);
     $conditions = array();
     if (is_array($value)) {
         $value = implode(',', $value);
     }
     // now clean up the value
     if ($metakey == 'store_billing_layout' || $metakey == 'store_shipping_layout' || $metakey == 'store_payment_layout') {
         $value = $app->input->get($metakey, '', 'raw');
         $clean_value = $filter->clean($value, 'html');
     } else {
         $clean_value = $filter->clean($value, 'string');
     }
     $config->set($metakey, $clean_value);
     $conditions[] = '(' . $db->q(strip_tags($metakey)) . ',' . $db->q($clean_value) . ')';
     $query .= implode(',', $conditions);
     try {
         $db->setQuery($query);
         $db->execute();
     } catch (Exception $e) {
         return false;
     }
     return true;
 }
开发者ID:davetheapple,项目名称:oakencraft,代码行数:29,代码来源:config.php



注:本文中的JFilterInput类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP JFilterOutput类代码示例发布时间:2022-05-23
下一篇:
PHP JFile类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap