当前位置: 首页>>代码示例>>PHP>>正文


PHP JDatabase::getEscaped方法代码示例

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


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

示例1: generateJsonResponse

 public function generateJsonResponse($action, $do, $data)
 {
     $response = '';
     if (JDEBUG == 1 && defined('JFIREPHP')) {
         FB::log("Kunena JSON action: " . $action);
     }
     // Sanitize $data variable
     $data = $this->_db->getEscaped($data);
     if ($this->_my->id) {
         // We only entertain json requests for registered and logged in users
         switch ($action) {
             case 'autocomplete':
                 $response = $this->_getAutoComplete($do, $data);
                 break;
             case 'preview':
                 $body = JRequest::getVar('body', '', 'post', 'string', JREQUEST_ALLOWRAW);
                 $response = $this->_getPreview($body);
                 break;
             case 'pollcatsallowed':
                 // TODO: deprecated
                 $response = $this->_getPollsCatsAllowed();
                 break;
             case 'pollvote':
                 $vote = JRequest::getInt('kpollradio', '');
                 $id = JRequest::getInt('kpoll-id', 0);
                 if (!JRequest::checkToken()) {
                     return false;
                 }
                 $response = $this->_addPollVote($vote, $id, $this->_my->id);
                 break;
             case 'pollchangevote':
                 $vote = JRequest::getInt('kpollradio', '');
                 $id = JRequest::getInt('kpoll-id', 0);
                 if (!JRequest::checkToken()) {
                     return false;
                 }
                 $response = $this->_changePollVote($vote, $id, $this->_my->id);
                 break;
             case 'anynomousallowed':
                 // TODO: deprecated
                 $response = $this->_anynomousAllowed();
                 break;
             case 'uploadfile':
                 $response = $this->_uploadFile($do);
                 break;
             case 'modtopiclist':
                 $response = $this->_modTopicList($data);
                 break;
             case 'removeattachment':
                 $response = $this->_removeAttachment($data);
                 break;
             default:
                 break;
         }
     } else {
         $response = array('status' => '-1', 'error' => JText::_('COM_KUNENA_AJAX_PERMISSION_DENIED'));
     }
     // Output the JSON data.
     return json_encode($response);
 }
开发者ID:vuchannguyen,项目名称:hoctap,代码行数:60,代码来源:kunena.ajax.helper.php

示例2: escape

 /**
  * Esegue l'escape di una stringa per l'inserimento in una query
  * FUNZIONE CHIAMATA DAL MODULO DEVE ESSERE SEMPRE IMPLEMENTATA QUI
  * @param string $text
  * @return string
  */
 public function escape($text)
 {
     if (version_compare(JVERSION, '1.6.0', 'ge')) {
         return $this->db->escape($text);
     } else {
         return $this->db->getEscaped($text);
     }
 }
开发者ID:alesconti,项目名称:FF_2015,代码行数:14,代码来源:ProPayment_Database.php

示例3: getEscaped

 /**
  * Get a database escaped string. For LIKE statemends: $db->Quote( $db->getEscaped( $text, true ) . '%', false )
  *
  * @param  string  $text
  * @param  boolean $escapeForLike : escape also % and _ wildcards for LIKE statements with % or _ in search strings  (since CB 1.2.3)
  * @return string
  */
 function getEscaped($text, $escapeForLike = false)
 {
     if (checkJversion() >= 2) {
         $result = $this->_db->escape($text);
     } else {
         $result = $this->_db->getEscaped($text);
     }
     if ($escapeForLike) {
         $result = str_replace(array('%', '_'), array("\\%", "\\_"), $result);
     }
     return $result;
 }
开发者ID:rogatnev-nikita,项目名称:cloudinterpreter,代码行数:19,代码来源:cb.database.php


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