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


PHP S::escapeChar方法代码示例

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


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

示例1: initCurrUpload

 function initCurrUpload($key, $value)
 {
     list($t, $i) = explode('_', $key);
     $arr = array('id' => intval($i), 'attname' => $t, 'name' => S::escapeChar($value['name']), 'size' => intval($value['size']), 'type' => 'zip', 'ifthumb' => 0, 'fileuploadurl' => '');
     $arr['ext'] = strtolower(substr(strrchr($arr['name'], '.'), 1));
     return $arr;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:7,代码来源:ver.customized.upload.php

示例2: setData

 function setData()
 {
     $bonus = S::escapeChar(S::getGP('bonus', 'P'), true);
     $ctype = S::escapeChar(S::getGP('ctype', 'P'));
     if (empty($bonus)) {
         $bonus = array();
         $bonus['best'] = $this->b_val;
         $bonus['active'] = $this->a_val;
     }
     $bonus['best'] < $this->b_val && Showmsg('credit_limit');
     $bonus['active'] < $this->a_val && Showmsg('credit_limit');
     reset($this->allowcredit);
     if (!$ctype['best']) {
         $ctype['best'] = current($this->allowcredit);
     }
     if (!$ctype['active']) {
         $ctype['active'] = current($this->allowcredit);
     }
     if (!in_array($ctype['best'], $this->allowcredit) || !in_array($ctype['active'], $this->allowcredit)) {
         Showmsg('reward_credit_error');
     }
     $this->data['cbtype'] = $ctype['best'];
     $this->data['catype'] = $ctype['active'];
     $this->data['cbval'] = $bonus['best'];
     $this->data['caval'] = $bonus['active'];
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:26,代码来源:post_3.class.php

示例3: writetoollog

function writetoollog($log)
{
    global $db, $db_bbsurl;
    $log['type'] = getLangInfo('toollog', $log['type']);
    $log['filename'] = S::escapeChar($log['filename']);
    $log['username'] = S::escapeChar($log['username']);
    $log['descrip'] = S::escapeChar(getLangInfo('toollog', $log['descrip'], $log));
    $db->update("INSERT INTO pw_toollog SET " . S::sqlSingle(array('type' => $log['type'], 'filename' => $log['filename'], 'nums' => $log['nums'], 'money' => $log['money'], 'descrip' => $log['descrip'], 'uid' => $log['uid'], 'touid' => $log['touid'], 'username' => $log['username'], 'ip' => $log['ip'], 'time' => $log['time'])));
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:9,代码来源:tool.php

示例4: writeforumlog

function writeforumlog($log)
{
    $log['username1'] = S::escapeChar($log['username1']);
    $log['username2'] = S::escapeChar($log['username2']);
    $log['field1'] = S::escapeChar($log['field1']);
    $log['field2'] = S::escapeChar($log['field2']);
    $log['field3'] = S::escapeChar($log['field3']);
    $log['descrip'] = S::escapeChar(getLangInfo('log', $log['descrip'], $log));
    $GLOBALS['db']->update("INSERT INTO pw_forumlog SET " . S::sqlSingle(array('type' => $log['type'], 'username1' => $log['username1'], 'username2' => $log['username2'], 'field1' => $log['field1'], 'field2' => $log['field2'], 'field3' => $log['field3'], 'descrip' => $log['descrip'], 'timestamp' => $log['timestamp'], 'ip' => $log['ip']), false));
}
开发者ID:jechiy,项目名称:PHPWind,代码行数:10,代码来源:writelog.php

示例5: update

 function update($uploaddb)
 {
     global $db_charset;
     $this->transfer();
     foreach ($uploaddb as $value) {
         $value['descrip'] = S::escapeChar(S::getGP('atc_desc' . $value['id'], 'P'));
         $value['name'] = stripslashes(pwConvert($value['name'], $db_charset, 'utf-8'));
         $this->attachs[] = $value;
     }
     return $uploaddb;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:11,代码来源:articleupload.class.php

示例6: getBbsUrl

function getBbsUrl()
{
    global $pwServer, $db_dir;
    $dirstrpos = strpos($pwServer['PHP_SELF'], $db_dir);
    if ($dirstrpos !== false) {
        $tmp = substr($pwServer['PHP_SELF'], 0, $dirstrpos);
        $pwServer['PHP_SELF'] = "{$tmp}.php";
    } else {
        $tmp = $pwServer['PHP_SELF'];
    }
    return S::escapeChar("http://" . $pwServer['HTTP_HOST'] . substr($tmp, 0, strrpos($tmp, '/')));
}
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:12,代码来源:ver.customized.functions.php

示例7: publishTemplatizedAction

 function publishTemplatizedAction($uid, $descrip, $appid)
 {
     //插入动态信息
     global $timestamp;
     //$rt = $this->db->get_one("SELECT * FROM pw_userapp WHERE uid=".S::sqlEscape($uid)." AND appid=".S::sqlEscape($appid));
     $appclient = L::loadClass('appclient');
     $rt = $appclient->getUserAppByUidAndAppid($uid, $appid);
     if ($rt['allowfeed']) {
         $descrip = S::escapeChar($descrip);
         $this->db->update("INSERT INTO pw_feed SET " . S::sqlSingle(array('uid' => $uid, 'type' => 'app', 'descrip' => $descrip, 'timestamp' => $timestamp), false));
         return new ApiResponse(true);
     }
     return new ApiResponse(false);
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:14,代码来源:class_Feed.php

示例8: setCustomdata

 function setCustomdata($customdata)
 {
     global $db_union;
     if (!is_array($db_union)) {
         $db_union = explode("\t", stripslashes($db_union));
     }
     $custominfo = unserialize($db_union[7]);
     if ($custominfo && $customdata) {
         foreach ($customdata as $key => $val) {
             $key = S::escapeChar($key);
             $customdata[stripslashes($key)] = stripslashes($val);
         }
         $this->memberinfo['customdata'] = serialize($customdata);
     }
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:15,代码来源:register.class.php

示例9: _setData

 function _setData()
 {
     $goodsname = S::escapeChar(S::getGP('goodsname'));
     $price = S::escapeChar(S::getGP('price'));
     $costprice = S::escapeChar(S::getGP('costprice'));
     $locus = S::escapeChar(S::getGP('locus'));
     $mailfee = S::escapeChar(S::getGP('mailfee'));
     $expressfee = S::escapeChar(S::getGP('expressfee'));
     $emsfee = S::escapeChar(S::getGP('emsfee'));
     $icon = S::escapeChar(S::getGP('attachment_1'));
     $degree = intval(S::getGP('degree'));
     $ptype = intval(S::getGP('ptype'));
     $goodsnum = intval(S::getGP('goodsnum'));
     $paymethod = S::escapeChar(S::getGP('paymethod'), 1);
     $transport = intval(S::getGP('transport'));
     !$goodsname && ($goodsname = S::escapeChar($_POST['atc_title']));
     if (!is_numeric($costprice) || $costprice <= 0) {
         Showmsg('goods_setprice');
     }
     $goodsnum < 1 && Showmsg('goods_num_error');
     $paymethod && ($paymethod = array_sum($paymethod));
     $paymethod < 1 && Showmsg('goods_pay_error');
     !is_numeric($price) && ($price = 0);
     if ($transport) {
         !is_numeric($mailfee) && ($mailfee = 0);
         !is_numeric($expressfee) && ($expressfee = 0);
         !is_numeric($emsfee) && ($emsfee = 0);
         if (!$mailfee && !$expressfee && !$emsfee) {
             Showmsg('goods_logistics');
         }
     } else {
         $mailfee = $expressfee = $emsfee = 0;
     }
     $goodsicon = '';
     $this->data['name'] = $goodsname;
     $this->data['price'] = $price;
     $this->data['costprice'] = $costprice;
     $this->data['locus'] = $locus;
     $this->data['mailfee'] = $mailfee;
     $this->data['expressfee'] = $expressfee;
     $this->data['emsfee'] = $emsfee;
     $this->data['degree'] = $degree;
     $this->data['type'] = $ptype;
     $this->data['num'] = $goodsnum;
     $this->data['paymethod'] = $paymethod;
     $this->data['transport'] = $transport;
     $icon && ($this->data['icon'] = $icon);
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:48,代码来源:post_4.class.php

示例10: add

 function add($uid, $appid, $appname, $allowfeed, $descrip)
 {
     global $timestamp;
     /*
     $this->db->update("REPLACE INTO pw_userapp SET " . S::sqlSingle(array(
     	'uid'		=> $uid,
     	'appid'		=> $appid,
     	'appname'	=> $appname,
     )));
     */
     pwQuery::replace('pw_userapp', array('uid' => $uid, 'appid' => $appid, 'appname' => $appname));
     if ($allowfeed) {
         $descrip = S::escapeChar($descrip);
         $this->db->update("INSERT INTO pw_feed SET " . S::sqlSingle(array('uid' => $uid, 'type' => 'app', 'descrip' => $descrip, 'timestamp' => $timestamp), false));
     }
     return new ApiResponse(true);
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:17,代码来源:class_UserApp.php

示例11: sendMessage

 /**
  * 以某个用户的身份给另一个用户发送短消息
  * @param int $userId 发送者uid
  * @param string $receiver 接受者用户名
  * @param string $subject 标题
  * @param string $content 内容
  * return bool
  */
 function sendMessage($userId, $receiver, $subject, $content)
 {
     global $winddb, $winduid, $windid, $groupid, $_G, $SYSTEM;
     $userService = $this->_getUserService();
     $winddb = $userService->get($userId, true, true);
     $winduid = $winddb['uid'];
     $groupid = $winddb['groupid'];
     $windid = $winddb['username'];
     $groupid == '-1' && ($groupid = $winddb['memberid']);
     if (file_exists(D_P . "data/groupdb/group_{$groupid}.php")) {
         extract(pwCache::getData(S::escapePath(D_P . "data/groupdb/group_{$groupid}.php", false)));
     } else {
         extract(pwCache::getData(D_P . 'data/groupdb/group_1.php', false));
     }
     M::sendMessage($userId, array($receiver), array('create_uid' => $winduid, 'create_username' => $windid, 'title' => S::escapeChar(stripslashes($subject)), 'content' => S::escapeChar(stripslashes($content))));
     return new ApiResponse(true);
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:25,代码来源:class_Msg.php

示例12: _setData

 function _setData()
 {
     $this->data['subject'] = S::escapeChar(S::getGP('act_subject', 'P'));
     $this->data['location'] = S::escapeChar(S::getGP('act_location', 'P'));
     $this->data['sexneed'] = intval(S::getGP('act_sex'));
     $act_starttime = S::escapeChar(S::getGP('act_starttime'));
     $act_deadline = S::escapeChar(S::getGP('act_deadline'));
     $act_endtime = S::escapeChar(S::getGP('act_endtime'));
     $act_num = intval(S::getGP('act_num'));
     $act_costs = intval(S::getGP('act_costs'));
     !($this->data['subject'] && $act_starttime && $act_deadline) && Showmsg('active_data_empty');
     $act_starttime = PwStrtoTime($act_starttime);
     $act_endtime = PwStrtoTime($act_endtime);
     $act_deadline = PwStrtoTime($act_deadline);
     $act_num < 1 && ($act_num = 0);
     $act_costs < 1 && ($act_costs = 0);
     $this->data['starttime'] = $act_starttime;
     $this->data['deadline'] = $act_deadline;
     $this->data['endtime'] = $act_endtime;
     $this->data['num'] = $act_num;
     $this->data['costs'] = $act_costs;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:22,代码来源:post_2.class.php

示例13: PW_Appclient

 function PW_Appclient()
 {
     global $db_siteappkey, $timestamp, $db_sitehash, $db_siteownerid, $db_siteid, $db_charset, $db_appifopen, $pwServer, $db_server_url, $db_bbsname;
     $db_bbsurl = S::escapeChar("http://" . $pwServer['HTTP_HOST'] . substr($pwServer['PHP_SELF'], 0, strrpos($pwServer['PHP_SELF'], '/')));
     if (!file_exists(D_P . "data/bbscache/forum_appinfo.php")) {
         require_once R_P . "admin/cache.php";
         updatecache_f();
     }
     //* @include_once pwCache::getPath(D_P . "data/bbscache/forum_appinfo.php");
     extract(pwCache::getData(D_P . "data/bbscache/forum_appinfo.php", false));
     $this->_db = $GLOBALS['db'];
     $this->appkey = $db_siteappkey;
     $this->timestamp = $timestamp;
     $this->siteid = $db_siteid;
     $this->siteownerid = $db_siteownerid;
     $this->sitehash = $db_sitehash;
     $this->bbsname = $db_bbsname;
     $this->bbsurl = $db_bbsurl;
     $this->charset = $db_charset;
     $this->appifopen = $db_appifopen;
     $this->server_url = $db_server_url;
     $this->appinfo = $forum_appinfo;
 }
开发者ID:sherlockhouse,项目名称:aliyun,代码行数:23,代码来源:appclient.class.php

示例14: _setData

 function _setData()
 {
     global $timestamp;
     $endtime = S::escapeChar(S::getGP('endtime'));
     $obtitle = S::escapeChar(S::getGP('obtitle'));
     $retitle = S::escapeChar(S::getGP('retitle'));
     $umpire = S::escapeChar(S::getGP('umpire'));
     $endtime = PwStrtoTime($endtime);
     $endtime < $timestamp && Showmsg('debate_time');
     if (empty($obtitle) || empty($retitle)) {
         Showmsg('debate_notitle');
     } elseif (strlen($obtitle) > 255 || strlen($retitle) > 255) {
         Showmsg('debate_titlelen');
     }
     if ($umpire) {
         $umpireuid = $this->db->get_value("SELECT uid FROM pw_members WHERE username=" . S::sqlEscape($umpire));
         empty($umpireuid) && Showmsg('debate_noumpire');
     }
     $this->data['endtime'] = $endtime;
     $this->data['obtitle'] = $obtitle;
     $this->data['retitle'] = $retitle;
     $this->data['umpire'] = $umpire;
     $this->data['postdate'] = $timestamp;
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:24,代码来源:post_5.class.php

示例15: setDataAlipay

 function setDataAlipay($uid, $tableName, $fieldName, $required = false)
 {
     if (!$this->memberData[$uid][$tableName]['tradeinfo']) {
         $userService = L::loadClass('UserService', 'user');
         /* @var $userService PW_UserService */
         $userInfo = $userService->get($uid, true, false, true);
         if (!$userInfo) {
             return false;
         }
         $this->memberData[$uid][$tableName]['tradeinfo'] = $userInfo['tradeinfo'];
     }
     $tradeInfo = @(array) unserialize($userInfo['tradeinfo']);
     $tradeInfo[$fieldName] = S::escapeChar(S::getGP($fieldName, 'P'));
     if (!$required && !$tradeInfo[$fieldName] || $tradeInfo[$fieldName] && $this->checkAlipay($tradeInfo[$fieldName]) === true) {
         $this->memberData[$uid][$tableName]['tradeinfo'] = serialize($tradeInfo);
         return true;
     } else {
         return false;
     }
 }
开发者ID:jechiy,项目名称:PHPWind,代码行数:20,代码来源:customerfielddata.class.php


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