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


PHP dstripslashes函数代码示例

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


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

示例1: getstr

function getstr($string, $length, $in_slashes = 0, $out_slashes = 0, $bbcode = 0, $html = 0)
{
    global $_G;
    $string = trim($string);
    $sppos = strpos($string, chr(0) . chr(0) . chr(0));
    if ($sppos !== false) {
        $string = substr($string, 0, $sppos);
    }
    if ($in_slashes) {
        $string = dstripslashes($string);
    }
    $string = preg_replace("/\\[hide=?\\d*\\](.*?)\\[\\/hide\\]/is", '', $string);
    if ($html < 0) {
        $string = preg_replace("/(\\<[^\\<]*\\>|\r|\n|\\s|\\[.+?\\])/is", ' ', $string);
    } elseif ($html == 0) {
        $string = dhtmlspecialchars($string);
    }
    if ($length) {
        $string = cutstr($string, $length);
    }
    if ($bbcode) {
        require_once DISCUZ_ROOT . './source/class/class_bbcode.php';
        $bb =& bbcode::instance();
        $string = $bb->bbcode2html($string, $bbcode);
    }
    if ($out_slashes) {
        $string = daddslashes($string);
    }
    return trim($string);
}
开发者ID:upyun,项目名称:discuz-plugin,代码行数:30,代码来源:function_home.php

示例2: feed_add

function feed_add($icon, $title_template = '', $title_data = array(), $body_template = '', $body_data = array(), $body_general = '', $images = array(), $image_links = array(), $target_ids = '', $friend = '', $appid = '', $returnid = 0, $id = 0, $idtype = '', $uid = 0, $username = '')
{
    global $_G;
    $title_template = $title_template ? lang('feed', $title_template) : '';
    $body_template = $body_template ? lang('feed', $body_template) : '';
    $body_general = $body_general ? lang('feed', $body_general) : '';
    if (empty($uid) || empty($username)) {
        $uid = $username = '';
    }
    $feedarr = array('appid' => $appid, 'icon' => $icon, 'uid' => $uid ? intval($uid) : $_G['uid'], 'username' => $username ? $username : $_G['username'], 'dateline' => $_G['timestamp'], 'title_template' => $title_template, 'body_template' => $body_template, 'body_general' => $body_general, 'image_1' => empty($images[0]) ? '' : $images[0], 'image_1_link' => empty($image_links[0]) ? '' : $image_links[0], 'image_2' => empty($images[1]) ? '' : $images[1], 'image_2_link' => empty($image_links[1]) ? '' : $image_links[1], 'image_3' => empty($images[2]) ? '' : $images[2], 'image_3_link' => empty($image_links[2]) ? '' : $image_links[2], 'image_4' => empty($images[3]) ? '' : $images[3], 'image_4_link' => empty($image_links[3]) ? '' : $image_links[3], 'target_ids' => $target_ids, 'friend' => $friend, 'id' => $id, 'idtype' => $idtype);
    $feedarr = dstripslashes($feedarr);
    $feedarr['title_data'] = serialize(dstripslashes($title_data));
    $feedarr['body_data'] = serialize(dstripslashes($body_data));
    $feedarr['hash_data'] = empty($title_data['hash_data']) ? '' : $title_data['hash_data'];
    $feedarr = daddslashes($feedarr);
    if (is_numeric($icon)) {
        $feed_table = 'home_feed_app';
        unset($feedarr['id'], $feedarr['idtype']);
    } else {
        if ($feedarr['hash_data']) {
            $query = DB::query("SELECT feedid FROM " . DB::table('home_feed') . " WHERE uid='{$feedarr['uid']}' AND hash_data='{$feedarr['hash_data']}' LIMIT 0,1");
            if ($oldfeed = DB::fetch($query)) {
                return 0;
            }
        }
        $feed_table = 'home_feed';
    }
    if ($returnid) {
        return DB::insert($feed_table, $feedarr, $returnid);
    } else {
        DB::insert($feed_table, $feedarr);
        return 1;
    }
}
开发者ID:dalinhuang,项目名称:hlwbbsvincent,代码行数:34,代码来源:function_feed.php

示例3: init_input

 function init_input()
 {
     if (MAGIC_QUOTES_GPC) {
         $_GET = dstripslashes($_GET);
         $_POST = dstripslashes($_POST);
         $_COOKIE = dstripslashes($_COOKIE);
     }
 }
开发者ID:huiwei19,项目名称:oursustc-php,代码行数:8,代码来源:core.php

示例4: url_implode

function url_implode($gets)
{
    $arr = array();
    foreach ($gets as $key => $value) {
        if ($value) {
            $arr[] = $key . '=' . urlencode(dstripslashes($value));
        }
    }
    return implode('&', $arr);
}
开发者ID:v998,项目名称:discuzx-en,代码行数:10,代码来源:function_home.php

示例5: dstripslashes

function dstripslashes($string)
{
    if (!is_array($string)) {
        return stripslashes($string);
    }
    foreach ($string as $key => $val) {
        $string[$key] = dstripslashes($val);
    }
    return $string;
}
开发者ID:oneoneplus,项目名称:webshell,代码行数:10,代码来源:global.func.php

示例6: set

	function set()
	{
		global $_CONFIG;
		$func_num_args=func_num_args();
		$func_args=func_get_args();
		$value=array_pop($func_args);
				$value = dstripslashes($value);
		$type=array_shift($func_args);

		$remark = '/'.'*********************************************
 *[tttuangou] (C)2005 - 2010 Cenwor Inc.
 *
 * tttuangou '.$type.'配置
 *
 * @author www.tttuangou.net
 *
 * @time '.date('Y-m-d H:i').'
 *********************************************'.'/

 ';

		$file=ConfigHandler::file($type);
		if($type===null)
		{
			$data="<?php \r\n {$remark} \r\n \$config=".var_export($value,true)."; \r\n ?>";
		}
		else
		{
			if(($config=$_CONFIG[$type])===null)
			{
				$config=array();
				@include($file);
				$config=$config[$type];
			}
			foreach($func_args as $arg)
			{
				$path_str.="['$arg']";
			}
			eval($value===null?'unset($config'.$path_str.');':'$config'.$path_str.'=$value;');
			$data="<?php \r\n {$remark} \r\n\$config['$type']=".var_export($config,true).";\r\n?>";
		}

		@$fp=fopen($file,'wb');
		if(!$fp)
		{
			zlog('error')->found('denied.io', $file);
			die($file."文件无法写入,请检查是否有可写权限。");
		}
		$len=fwrite($fp, $data);
		fclose($fp);

		if($len)$_CONFIG[$type]=$config;
		return $len;
	}
开发者ID:pf5512,项目名称:phpstudy,代码行数:54,代码来源:config.han.php

示例7: dstripslashes

function dstripslashes($string)
{
    if (empty($string)) {
        return $string;
    }
    if (is_array($string)) {
        foreach ($string as $key => $val) {
            $string[$key] = dstripslashes($val);
        }
    } else {
        $string = stripslashes($string);
    }
    return $string;
}
开发者ID:huiwei19,项目名称:oursustc-php,代码行数:14,代码来源:common.php

示例8: daddslashes

function daddslashes($string, $force = 0)
{
    if (!$GLOBALS['magic_quotes_gpc'] || $force) {
        if (is_array($string)) {
            foreach ($string as $key => $val) {
                $string[$key] = daddslashes($val, $force);
            }
        } else {
            //如果魔术引用开启或$force为0
            //下面是一个三元操作符,如果$strip为true则执行stripslashes去掉反斜线字符,再执行addslashes
            //$strip为true的,也就是先去掉反斜线字符再进行转义的为$_GET,$_POST,$_COOKIE和$_REQUEST $_REQUEST数组包含了前三个数组的值
            //这里为什么要将$string先去掉反斜线再进行转义呢,因为有的时候$string有可能有两个反斜线,stripslashes是将多余的反斜线过滤掉
            $string = addslashes($strip ? dstripslashes($string) : $string);
        }
    }
    return $string;
}
开发者ID:h3len,项目名称:Project,代码行数:17,代码来源:functions.php

示例9: dsu_amucallme_output

 function dsu_amucallme_output($a)
 {
     global $_G;
     if ($_G['uid'] && in_array($_G['fid'], $this->fids)) {
         $turl = "forum.php?mod=redirect&goto=findpost&ptid={$a['values']['tid']}&pid={$a['values']['pid']}";
         $url = $_G["siteurl"] . $turl;
         $msg = $this->message;
         $reply = $_G["siteurl"] . "forum.php?mod=post&action=reply&tid={$a['values']['tid']}&repquote={$a['values']['pid']}";
         if (!$msg) {
             if (!function_exists('discuzcode')) {
                 include libfile('function/discuzcode');
             }
             $msg = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . cutstr(strip_tags(discuzcode($_G['gp_message'], 1, 0)), 40, '...');
         }
         $sendmsg = lang('plugin/dsu_amucallme', 'sendmsg', array('username' => $_G['username'], 'url' => $url, 'reply' => $reply, 'message' => $msg));
         $cmcost = array();
         if (file_exists('./data/plugindata/dsu_amucallme.data.php')) {
             require_once DISCUZ_ROOT . './data/plugindata/dsu_amucallme.data.php';
             $data_f2a = dstripslashes($data_f2a);
             $cmcost = $data_f2a[$_G['groupid']];
             $cmcost['cost'] = $cmcost['cost'] * '-1';
         }
         $max = 0;
         if ($cmcost['extcredits'] && $cmcost['cost']) {
             $max = intval($_G['member']["extcredits{$cmcost['extcredits']}"] / $cmcost['cost']);
         } else {
             $max = 100;
         }
         if ($a['values']['tid'] && $a['values']['pid'] && $max) {
             foreach ($this->usernames as $key => $val) {
                 if ($val && $_G['uid'] != $val && $max) {
                     updatemembercount($_G['uid'], array("extcredits{$cmcost['extcredits']}" => $cmcost['cost']), true, '', 0);
                     notification_add($val, $_G['uid'], $sendmsg, '', 0);
                     $max--;
                 }
             }
             foreach ($this->gusernames as $key => $val) {
                 if ($val && $_G['uid'] != $val && $max) {
                     updatemembercount($_G['uid'], array("extcredits{$cmcost['extcredits']}" => $cmcost['cost']), true, '', 0);
                     notification_add($val, $_G['uid'], $sendmsg, '', 0);
                     $max--;
                 }
             }
         }
     }
 }
开发者ID:v998,项目名称:dsu,代码行数:46,代码来源:callme.class.php

示例10: run_timing

 function run_timing($a)
 {
     global $_G;
     $timestamp = TIMESTAMP;
     $processname = 'TIMING_CRON_CHECK';
     $check = DB::result(DB::query("SELECT COUNT(*) FROM " . DB::table('strayer_timing') . " WHERE public_dateline<='{$timestamp}' "), 0);
     if ($check) {
         discuz_process::unlock($processname);
     }
     if (discuz_process::islocked($processname, 600)) {
         return false;
     }
     if (!$check) {
         return FALSE;
     }
     @set_time_limit(1000);
     @ignore_user_abort(TRUE);
     //防止发生异常,先预订一个1小时的总时间,假如发布文章需要2小时才完成。还未到2小时,又被触发了,这样会造成文章的重复发布
     save_syscache('pick_timing', TIMESTAMP + 60 * 60 * 1);
     $optype_arr = array(1 => 'move_portal', 2 => 'move_forums', 3 => 'move_blog');
     $query = DB::query("SELECT * FROM " . DB::table('strayer_timing') . " WHERE public_dateline<='{$timestamp}' ORDER by public_dateline");
     $timing_aid_arr = $tid_arr = $args = array();
     while ($rs = DB::fetch($query)) {
         $timing_aid_arr[] = dstripslashes($rs);
         $tid_arr[] = $rs['id'];
     }
     if (!$timing_aid_arr) {
         return;
     }
     pload('F:article,F:pick');
     article_timing_delete($tid_arr);
     //不管有没有发布成功,先清理掉定时发布表里面的数据,防止文章又被重复检测到
     foreach ($timing_aid_arr as $k => $rs) {
         $args = unserialize($rs['public_info']);
         $args['aid'] = array($rs['data_id']);
         $args['pid'] = $rs['pid'];
         $args['timing'] = 1;
         $args['cron_run'] = 1;
         $args['public_time'][$rs['data_id']] = $rs['public_dateline'];
         article_import($optype_arr[$rs['public_type']], $args);
     }
     save_syscache('pick_timing', TIMESTAMP + 600);
     //成功运行,时间按正常设置
     discuz_process::unlock($processname);
     return true;
 }
开发者ID:edmundwong,项目名称:V604,代码行数:46,代码来源:cron.class.php

示例11: on_login

 function on_login()
 {
     global $_G;
     empty($mrefreshtime) && ($mrefreshtime = 2000);
     if ($_G['uid']) {
         $ucsynlogin = uc_user_synlogin($_G['uid']);
         $param = array('username' => $_G['member']['username'], 'ucsynlogin' => $ucsynlogin, 'uid' => $_G['member']['uid']);
         showmessage('login_succeed', dreferer(), $param, array('showdialog' => 1, 'locationtime' => 1));
     }
     if (!($_G['member_loginperm'] = logincheck())) {
         showmessage('login_strike');
     }
     if (!submitcheck('loginsubmit', 1)) {
         $_G['referer'] = dreferer();
         $cookietimecheck = !empty($_G['cookie']['cookietime']) ? 'checked="checked"' : '';
         $username = !empty($_G['cookie']['loginuser']) ? htmlspecialchars($_G['cookie']['loginuser']) : '';
         include template('member/login');
     } else {
         $_G['uid'] = $_G['member']['uid'] = 0;
         $_G['username'] = $_G['member']['username'] = $_G['member']['password'] = '';
         $result = userlogin($_G['gp_username'], $_G['gp_password'], null, null, 'auto');
         if ($result['status'] > 0) {
             setloginstatus($result['member'], $_G['gp_cookietime'] ? 2592000 : 0);
             $ucsynlogin = uc_user_synlogin($_G['uid']);
             $message = 1;
             $param = array('username' => $_G['member']['username'], 'ucsynlogin' => $ucsynlogin, 'uid' => $_G['uid']);
             showmessage('login_succeed', dreferer(), $param, array('showdialog' => 1, 'locationtime' => 1));
         } else {
             $password = preg_replace("/^(.{" . round(strlen($_G['gp_password']) / 4) . "})(.+?)(.{" . round(strlen($_G['gp_password']) / 6) . "})\$/s", "\\1***\\3", $_G['gp_password']);
             $errorlog = dhtmlspecialchars(TIMESTAMP . "\t" . ($result['ucresult']['username'] ? $result['ucresult']['username'] : dstripslashes($_G['gp_username'])) . "\t" . $password . "\t" . "Ques #" . intval($_G['gp_questionid']) . "\t" . $_G['clientip']);
             writelog('illegallog', $errorlog);
             loginfailed($_G['member_loginperm']);
             $fmsg = $result['ucresult']['uid'] == '-3' ? empty($_G['gp_questionid']) || $answer == '' ? 'login_question_empty' : 'login_question_invalid' : 'login_invalid';
             showmessage($fmsg, '', array('loginperm' => $_G['member_loginperm']));
         }
     }
 }
开发者ID:pan289091315,项目名称:Discuz,代码行数:37,代码来源:member_logging.php

示例12: COUNT

 $totalmembers = DB::result_first("SELECT COUNT(*) FROM " . DB::table('common_member'));
 $userstats = array('totalmembers' => $totalmembers, 'newsetuser' => $username);
 save_syscache('userstats', $userstats);
 if ($_G['setting']['regctrl'] || $_G['setting']['regfloodctrl']) {
     DB::query("DELETE FROM " . DB::table('common_regip') . " WHERE dateline<='{$_G['timestamp']}'-" . ($_G['setting']['regctrl'] > 72 ? $_G['setting']['regctrl'] : 72) . "*3600", 'UNBUFFERED');
     if ($_G['setting']['regctrl']) {
         DB::query("INSERT INTO " . DB::table('common_regip') . " (ip, count, dateline)\r\n\t\t\t\tVALUES ('{$_G['clientip']}', '-1', '{$_G['timestamp']}')");
     }
 }
 $regmessage = dhtmlspecialchars($_G['gp_regmessage']);
 if ($_G['setting']['regverify'] == 2) {
     DB::query("REPLACE INTO " . DB::table('common_member_validate') . " (uid, submitdate, moddate, admin, submittimes, status, message, remark)\r\n\t\t\tVALUES ('{$uid}', '{$_G['timestamp']}', '0', '', '1', '0', '{$regmessage}', '')");
 }
 $_G['uid'] = $uid;
 $_G['username'] = $username;
 $_G['member']['username'] = dstripslashes($_G['username']);
 $_G['member']['password'] = $password;
 $_G['groupid'] = $groupinfo['groupid'];
 include_once libfile('function/stat');
 updatestat('register');
 $_CORE =& discuz_core::instance();
 $_CORE->session->set('uid', $uid);
 $_CORE->session->set('username', $username);
 dsetcookie('auth', authcode("{$_G['member']['password']}\t{$_G['uid']}", 'ENCODE'), 2592000, 1, true);
 if ($invite['id']) {
     DB::update("common_invite", array('fuid' => $uid, 'fusername' => $username, 'regdateline' => $_G['timestamp'], 'status' => 2), array('id' => $invite['id']));
     updatestat('invite');
 }
 if ($invite['uid']) {
     if ($_G['setting']['inviteconfig']['inviteaddcredit']) {
         updatemembercount($uid, array($_G['setting']['inviteconfig']['inviterewardcredit'] => $_G['setting']['inviteconfig']['inviteaddcredit']));
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:member_register.php

示例13: dgmdate

    $tradelog['lastupdate'] = dgmdate($tradelog['lastupdate'], 'u');
    $tradelog['statusview'] = trade_getstatus($tradelog['status']);
    $messagelist = array();
    if ($tradelog['offline']) {
        $offlinenext = trade_offline($tradelog, 1, $trade_message);
        $message = explode("\t\t\t", dstripslashes($tradelog['message']));
        foreach ($message as $row) {
            $row = explode("\t", $row);
            $row[2] = dgmdate($row[2], 'u');
            $row[0] && ($messagelist[] = $row);
        }
    } else {
        $loginurl = trade_getorderurl($tradelog['tradeno']);
    }
    $tradelog['buyer'] = dstripslashes($tradelog['buyer']);
    $tradelog['seller'] = dstripslashes($tradelog['seller']);
    $trade = DB::fetch_first("SELECT * FROM " . DB::table('forum_trade') . " WHERE tid='{$tradelog['tid']}' AND pid='{$tradelog['pid']}'");
    include template('forum/trade_view');
} else {
    if (empty($_G['gp_pid'])) {
        $posttable = getposttablebytid($_G['tid']);
        $pid = DB::result_first("SELECT pid FROM " . DB::table($posttable) . " WHERE tid='{$_G['tid']}' AND first='1' LIMIT 1");
    } else {
        $pid = $_G['gp_pid'];
    }
    if (DB::result_first("SELECT closed FROM " . DB::table('forum_thread') . " WHERE tid='{$_G['tid']}'")) {
        showmessage('trade_closed', 'forum.php?mod=viewthread&tid=' . $_G['tid'] . '&page=' . $page);
    }
    $trade = DB::fetch_first("SELECT * FROM " . DB::table('forum_trade') . " WHERE tid='{$_G['tid']}' AND pid='{$pid}'");
    if (empty($trade)) {
        showmessage('undefined_action', NULL);
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:forum_trade.php

示例14: libfile

     } else {
         $type = DB::result_first("SELECT type FROM " . DB::table('advertisement') . " WHERE advid='{$advid}'");
     }
     if ($advnew['style'] == 'image' || $advnew['style'] == 'flash') {
         if ($_FILES['advnew' . $advnew['style']]) {
             require_once libfile('class/upload');
             $upload = new discuz_upload();
             if ($upload->init($_FILES['advnew' . $advnew['style']], 'common') && $upload->save()) {
                 $advnew[$advnew['style']]['url'] = $_G['setting']['attachurl'] . 'common/' . $upload->attach['attachment'];
             }
         } else {
             $advnew[$advnew['style']]['url'] = $_G['gp_advnew' . $advnew['style']];
         }
     }
     foreach ($advnew[$advnew['style']] as $key => $val) {
         $advnew[$advnew['style']][$key] = dstripslashes($val);
     }
     $advnew['displayorder'] = isset($advnew['displayorder']) ? implode("\t", $advnew['displayorder']) : '';
     $advnew['code'] = encodeadvcode($advnew);
     $extra = $type != 'custom' ? '' : '&customid=' . $parameters['extra']['customid'];
     $advnew['parameters'] = addslashes(serialize(array_merge(is_array($parameters) ? $parameters : array(), array('style' => $advnew['style']), $advnew['style'] == 'code' ? array() : $advnew[$advnew['style']], array('html' => $advnew['code']), array('displayorder' => $advnew['displayorder']))));
     $advnew['code'] = addslashes($advnew['code']);
     $query = DB::query("UPDATE " . DB::table('advertisement') . " SET title='{$advnew['title']}', targets='{$advnew['targets']}', parameters='{$advnew['parameters']}', code='{$advnew['code']}', starttime='{$advnew['starttime']}', endtime='{$advnew['endtime']}' WHERE advid='{$advid}'");
     updatecache('advs');
     updatecache('setting');
     if ($operation == 'edit') {
         cpmsg('adv_succeed', $_G['gp_referer'], 'succeed');
     } else {
         cpmsg('adv_succeed', 'action=adv&operation=edit&advid=' . $advid . $extra, 'succeed');
     }
 }
开发者ID:pan289091315,项目名称:Discuz,代码行数:31,代码来源:adv.inc.php

示例15: exit

<?php

/*
 * @copyright   Leyun internet Technology(Shanghai)Co.,Ltd
 * @license     http://www.dzzoffice.com/licenses/license.txt
 * @package     DzzOffice
 * @link        http://www.dzzoffice.com
 * @author      zyx(zyx@dzz.cc)
 */
if (!defined('IN_DZZ')) {
    exit('Access Denied');
}
define('MP3_DIR', 'dzz/player/mp3/');
$do = $_GET['do'];
if ($do == 'saveplaylist') {
    $paylist = trim($_POST['data']);
    DB::insert('user_playlist', array('uid' => $_G['uid'], 'playlist' => $paylist, 'updatetime' => $_G['timestamp']), 1, 1);
    exit;
} elseif ($do == 'getplaylist') {
    if (!($playarr = dstripslashes(unserialize(stripslashes(DB::result_first("select playlist from " . DB::table('user_playlist') . " where   uid='{$_G[uid]}'")))))) {
        $playarr = array();
    }
    $return = array('playlist' => $playarr, 'isadmin' => 1);
    echo json_encode($return);
    exit;
} else {
    //exit('dddd==='.template('player:mp3/index'));
    $icoid = trim($_GET['icoid']);
    include template('jplayer');
    //exit('dfdfd');
}
开发者ID:druphliu,项目名称:dzzoffice,代码行数:31,代码来源:jplayer.php


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