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


PHP dsafe函数代码示例

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


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

示例1: set

 function set($post)
 {
     global $MOD, $DT_TIME, $_username, $_userid;
     $post['edittime'] = $DT_TIME;
     $post['title'] = trim($post['title']);
     $post['listorder'] = intval($post['listorder']);
     clear_upload($post['content']);
     if ($this->itemid) {
         $post['editor'] = $_username;
         $new = $post['content'];
         $r = $this->get_one();
         $old = $r['content'];
         delete_diff($new, $old);
     } else {
         $post['addtime'] = $DT_TIME;
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = dsafe($content);
     if ($MOD['page_clear'] || $MOD['page_save']) {
         $post['content'] = stripslashes($post['content']);
         $post['content'] = save_local($post['content']);
         if ($MOD['page_clear']) {
             $post['content'] = clear_link($post['content']);
         }
         if ($MOD['page_save']) {
             $post['content'] = save_remote($post['content']);
         }
         $post['content'] = addslashes($post['content']);
     }
     return array_map("trim", $post);
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:33,代码来源:page.class.php

示例2: fields_update

function fields_update($post_fields, $table, $itemid, $keyname = 'itemid', $fd = array())
{
    global $FD, $db;
    if (!$table || !$itemid) {
        return '';
    }
    if ($fd) {
        $FD = $fd;
    }
    $sql = '';
    foreach ($FD as $k => $v) {
        if (isset($post_fields[$v['name']]) || $v['html'] == 'checkbox') {
            $mk = $v['name'];
            $mv = $post_fields[$v['name']];
            if ($v['html'] == 'checkbox') {
                $mv = implode(',', $post_fields[$v['name']]);
            }
            $mv = $v['html'] == 'editor' ? dsafe($mv) : dhtmlspecialchars(trim($mv));
            $sql .= ",{$mk}='{$mv}'";
        }
    }
    $sql = substr($sql, 1);
    if ($sql) {
        $db->query("UPDATE {$table} SET {$sql} WHERE `{$keyname}`={$itemid}");
    }
}
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:26,代码来源:fields.func.php

示例3: set

 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
     $post['editor'] = $_username;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['edittime'] = $DT_TIME;
     $post['fee'] = dround($post['fee']);
     $post['video'] = fix_link(trim($post['video']));
     $post['video_width'] = intval($post['video_width']);
     $post['video_height'] = intval($post['video_height']);
     $post['title'] = trim($post['title']);
     $post['content'] = stripslashes($post['content']);
     $post['content'] = save_local($post['content']);
     if ($MOD['clear_link']) {
         $post['content'] = clear_link($post['content']);
     }
     if ($MOD['save_remotepic']) {
         $post['content'] = save_remote($post['content']);
     }
     if ($MOD['introduce_length']) {
         $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
     }
     if ($this->itemid) {
         $new = $post['content'];
         if ($post['thumb']) {
             $new .= '<img src="' . $post['thumb'] . '">';
         }
         $r = $this->get_one();
         $old = $r['content'];
         if ($r['thumb']) {
             $old .= '<img src="' . $r['thumb'] . '">';
         }
         delete_diff($new, $old);
         if ($r['video'] != $post['video']) {
             delete_upload($r['video'], match_userid($r['video']));
         }
     } else {
         $post['ip'] = $DT_IP;
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = addslashes(dsafe($content));
     return array_map("trim", $post);
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:45,代码来源:video.class.php

示例4: set

 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
     is_url($post['thumb']) or $post['thumb'] = '';
     $post['filepath'] = isset($post['filepath']) && is_filepath($post['filepath']) ? file_vname($post['filepath']) : '';
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['adddate'] = timetodate($post['addtime'], 3);
     $post['edittime'] = $DT_TIME;
     $post['fee'] = dround($post['fee']);
     $post['content'] = stripslashes($post['content']);
     $post['content'] = save_local($post['content']);
     if ($post['content'] && isset($post['clear_link']) && $post['clear_link']) {
         $post['content'] = clear_link($post['content']);
     }
     if ($post['content'] && isset($post['save_remotepic']) && $post['save_remotepic']) {
         $post['content'] = save_remote($post['content']);
     }
     if ($post['content'] && $post['thumb_no'] && !$post['thumb']) {
         $post['thumb'] = save_thumb($post['content'], $post['thumb_no'], $MOD['thumb_width'], $MOD['thumb_height']);
     }
     if ($MOD['introduce_length']) {
         $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
     }
     if ($this->itemid) {
         $post['editor'] = $_username;
         $new = $post['content'];
         if ($post['thumb']) {
             $new .= '<img src="' . $post['thumb'] . '"/>';
         }
         $r = $this->get_one();
         $old = $r['content'];
         if ($r['thumb']) {
             $old .= '<img src="' . $r['thumb'] . '"/>';
         }
         delete_diff($new, $old);
     } else {
         $post['username'] = $post['editor'] = $_username;
         $post['ip'] = $DT_IP;
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = addslashes(dsafe($content));
     return array_map("trim", $post);
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:45,代码来源:quote.class.php

示例5: set

 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['edittime'] = $DT_TIME;
     $post['title'] = trim($post['title']);
     $post['credit'] = intval($post['credit']);
     $post['fee'] = dround($post['fee']);
     $post['hidden'] = isset($post['hidden']) && $post['hidden'] ? 1 : 0;
     $post['editor'] = $_username;
     $post['content'] = stripslashes($post['content']);
     $post['content'] = save_local($post['content']);
     if ($MOD['clear_link']) {
         $post['content'] = clear_link($post['content']);
     }
     if ($MOD['save_remotepic']) {
         $post['content'] = save_remote($post['content']);
     }
     if ($MOD['introduce_length']) {
         $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
     }
     if ($this->itemid) {
         $new = $post['content'];
         if ($post['thumb']) {
             $new .= '<img src="' . $post['thumb'] . '">';
         }
         $r = $this->get_one();
         $old = $r['content'];
         if ($r['thumb']) {
             $old .= '<img src="' . $r['thumb'] . '">';
         }
         delete_diff($new, $old);
     } else {
         $post['aid'] = 0;
         $post['totime'] = $DT_TIME + $MOD['overdays'] * 86400;
         $post['process'] = 1;
         $post['ip'] = $DT_IP;
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = addslashes(dsafe($content));
     return array_map("trim", $post);
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:44,代码来源:know.class.php

示例6: set

 function set($post)
 {
     global $MOD, $DT_TIME, $_username, $_userid;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? datetotime($post['addtime']) : $DT_TIME;
     $post['edittime'] = $DT_TIME;
     $post['fromtime'] = datetotime($post['fromtime'] . ' 00:00:00');
     $post['totime'] = $post['totime'] ? datetotime($post['totime'] . ' 23:59:59') : 0;
     $post['title'] = trim($post['title']);
     clear_upload($post['content'] . $post['thumb']);
     if ($this->itemid) {
         $post['editor'] = $_username;
         $new = $post['content'];
         if ($post['thumb']) {
             $new .= '<img src="' . $post['thumb'] . '">';
         }
         $r = $this->get_one();
         $old = $r['content'];
         if ($r['thumb']) {
             $old .= '<img src="' . $r['thumb'] . '">';
         }
         delete_diff($new, $old);
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = dsafe($content);
     if ($MOD['credit_clear'] || $MOD['credit_save']) {
         $post['content'] = stripslashes($post['content']);
         $post['content'] = save_local($post['content']);
         if ($MOD['credit_clear']) {
             $post['content'] = clear_link($post['content']);
         }
         if ($MOD['credit_save']) {
             $post['content'] = save_remote($post['content']);
         }
         $post['content'] = addslashes($post['content']);
     }
     return array_map("trim", $post);
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:39,代码来源:honor.class.php

示例7: set

 function set($post)
 {
     global $DT_TIME, $_username;
     $post['status'] = $post['status'] == 3 ? 3 : 2;
     if ($this->itemid) {
         $post['edittime'] = $DT_TIME;
         $post['editor'] = $_username;
         $new = $post['content'];
         $r = $this->get_one();
         $old = $r['content'];
         delete_diff($new, $old);
     } else {
         $post['addtime'] = $DT_TIME;
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = dsafe($content);
     $post['content'] = addslashes(save_remote(save_local(stripslashes($post['content']))));
     clear_upload($post['content']);
     return array_map("trim", $post);
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:22,代码来源:reply.class.php

示例8: set

 function set($post)
 {
     global $MOD, $DT_TIME, $_username, $_userid;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['edittime'] = $DT_TIME;
     $post['content'] = addslashes(save_remote(save_local(stripslashes($post['content']))));
     $post['introduce'] = addslashes(get_intro($post['content'], 120));
     $post['passport'] = addslashes(get_user($post['username'], 'username', 'passport'));
     if ($this->itemid) {
         $post['editor'] = $_username;
         $new = $post['content'];
         $r = $this->get_one();
         $old = $r['content'];
         delete_diff($new, $old);
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = addslashes(dsafe($content));
     clear_upload($post['content']);
     return array_map("trim", $post);
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:22,代码来源:expert.class.php

示例9: message

 if ($r['status'] > 0) {
     message($L['ask_msg_edit']);
 }
 if ($submit) {
     $typeid = intval($typeid);
     if (!$typeid || !isset($TYPE[$typeid])) {
         message($L['pass_typeid']);
     }
     if (empty($title)) {
         message($L['pass_title']);
     }
     if (empty($content)) {
         message($L['pass_content']);
     }
     clear_upload($content);
     $content = dsafe(addslashes(save_remote(save_local(stripslashes($content)))));
     $fields = array('typeid' => $typeid, 'title' => $title);
     $fields = dhtmlspecialchars($fields);
     $fields['content'] = $content;
     $sql = '';
     foreach ($fields as $k => $v) {
         $sql .= ",{$k}='{$v}'";
     }
     $sql = substr($sql, 1);
     $db->query("UPDATE {$DT_PRE}ask SET {$sql} WHERE itemid={$itemid}");
     dmsg($L['op_edit_success'], $forward);
 } else {
     extract($r);
     $type_select = type_select($TYPE, 1, 'typeid', $L['choose_type'], $typeid, 'id="typeid"');
     $head_title = $L['ask_title_edit'];
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:31,代码来源:ask.inc.php

示例10: set

 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
     $post['islink'] = isset($post['islink']) ? 1 : 0;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['edittime'] = $DT_TIME;
     $post['cfg_photo'] = intval($post['cfg_photo']);
     $post['cfg_video'] = intval($post['cfg_video']);
     $post['cfg_type'] = intval($post['cfg_type']);
     $post['title'] = trim($post['title']);
     $post['content'] = stripslashes($post['content']);
     if ($post['content'] && isset($post['clear_link']) && $post['clear_link']) {
         $post['content'] = clear_link($post['content']);
     }
     if ($post['content'] && isset($post['save_remotepic']) && $post['save_remotepic']) {
         $post['content'] = save_remote($post['content']);
     }
     if ($MOD['introduce_length']) {
         $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
     }
     if ($this->itemid) {
         $post['editor'] = $_username;
         $new = $post['content'];
         if ($post['thumb']) {
             $new .= '<img src="' . $post['thumb'] . '">';
         }
         if ($post['banner']) {
             $new .= '<img src="' . $post['banner'] . '">';
         }
         $r = $this->get_one();
         $old = $r['content'];
         if ($r['thumb']) {
             $old .= '<img src="' . $r['thumb'] . '">';
         }
         if ($r['banner']) {
             $old .= '<img src="' . $r['banner'] . '">';
         }
         delete_diff($new, $old);
     } else {
         $post['username'] = $post['editor'] = $_username;
         $post['ip'] = $DT_IP;
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = addslashes(dsafe($content));
     return $post;
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:48,代码来源:special.class.php

示例11: check_add

 function check_add($post)
 {
     global $DT_TIME;
     if (isset($post['content'])) {
         $content = dsafe($post['content']);
         unset($post['content']);
         $post = dhtmlspecialchars($post);
         $post['content'] = $content;
     } else {
         $post = dhtmlspecialchars($post);
     }
     $content = addslashes(serialize($post));
     $this->db->query("REPLACE INTO {$this->table_member_check} (userid,username,content,addtime) VALUES ('{$this->userid}','{$this->username}','{$content}','{$DT_TIME}')");
 }
开发者ID:hiproz,项目名称:zhaotaoci.cc,代码行数:14,代码来源:member.class.php

示例12: set

 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
     $post['editor'] = $_username;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['edittime'] = $DT_TIME;
     $post['totime'] = $post['totime'] ? strtotime($post['totime'] . ' 23:59:59') : 0;
     $post['discount'] = dround($post['price'] * 10 / $post['marketprice'], 1);
     $post['savemoney'] = dround($post['marketprice'] - $post['price']);
     $post['fee'] = dround($post['fee']);
     $post['price'] = dround($post['price']);
     $post['marketprice'] = dround($post['marketprice']);
     $post['minamount'] = dround($post['minamount']);
     $post['amount'] = dround($post['amount']);
     $post['title'] = trim($post['title']);
     $post['content'] = stripslashes($post['content']);
     $post['content'] = save_local($post['content']);
     if ($MOD['clear_link']) {
         $post['content'] = clear_link($post['content']);
     }
     if ($MOD['save_remotepic']) {
         $post['content'] = save_remote($post['content']);
     }
     if ($post['content'] && !$post['introduce'] && $post['introduce_length']) {
         $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
     }
     if ($this->itemid) {
         $new = $post['content'];
         if ($post['thumb']) {
             $new .= '<img src="' . $post['thumb'] . '">';
         }
         $r = $this->get_one();
         $old = $r['content'];
         if ($r['thumb']) {
             $old .= '<img src="' . $r['thumb'] . '">';
         }
         delete_diff($new, $old);
     } else {
         $post['ip'] = $DT_IP;
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = addslashes(dsafe($content));
     return array_map("trim", $post);
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:46,代码来源:group.class.php

示例13: set

 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $_username, $_userid;
     $post['editor'] = $_username;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['adddate'] = timetodate($post['addtime'], 3);
     $post['edittime'] = $DT_TIME;
     $post['editdate'] = timetodate($post['edittime'], 3);
     $post['fee'] = dround($post['fee']);
     $post['price'] = dround($post['price']);
     $post['amount'] = intval($post['amount']);
     $post['mycatid'] = intval($post['mycatid']);
     $post['elite'] = $post['elite'] ? 1 : 0;
     if (strpos($post['v1'], '|') === false) {
         $post['n1'] = $post['v1'] = '';
     }
     if (strpos($post['v2'], '|') === false) {
         $post['n2'] = $post['v2'] = '';
     }
     if (strpos($post['v3'], '|') === false) {
         $post['n3'] = $post['v3'] = '';
     }
     $post['express_1'] = intval($post['express_1']);
     $post['express_name_1'] = trim($post['express_name_1']);
     $post['fee_start_1'] = dround($post['fee_start_1']);
     $post['fee_step_1'] = dround($post['fee_step_1']);
     $post['express_2'] = intval($post['express_2']);
     $post['express_name_2'] = trim($post['express_name_2']);
     $post['fee_start_2'] = dround($post['fee_start_2']);
     $post['fee_step_2'] = dround($post['fee_step_2']);
     $post['express_3'] = intval($post['express_3']);
     $post['express_name_3'] = trim($post['express_name_3']);
     $post['fee_start_3'] = dround($post['fee_start_3']);
     $post['fee_step_3'] = dround($post['fee_step_3']);
     $post['title'] = trim($post['title']);
     $post['content'] = stripslashes($post['content']);
     $post['content'] = save_local($post['content']);
     if ($MOD['clear_link']) {
         $post['content'] = clear_link($post['content']);
     }
     if ($MOD['save_remotepic']) {
         $post['content'] = save_remote($post['content']);
     }
     if ($MOD['introduce_length']) {
         $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
     }
     if ($this->itemid) {
         $new = $post['content'];
         if ($post['thumb']) {
             $new .= '<img src="' . $post['thumb'] . '">';
         }
         if ($post['thumb1']) {
             $new .= '<img src="' . $post['thumb1'] . '">';
         }
         if ($post['thumb2']) {
             $new .= '<img src="' . $post['thumb2'] . '">';
         }
         $r = $this->get_one();
         $old = $r['content'];
         if ($r['thumb']) {
             $old .= '<img src="' . $r['thumb'] . '">';
         }
         if ($r['thumb1']) {
             $old .= '<img src="' . $r['thumb1'] . '">';
         }
         if ($r['thumb2']) {
             $old .= '<img src="' . $r['thumb2'] . '">';
         }
         delete_diff($new, $old);
     } else {
         $post['ip'] = $DT_IP;
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = addslashes(dsafe($content));
     return array_map("trim", $post);
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:78,代码来源:mall.class.php

示例14: set

 function set($post)
 {
     global $MOD, $DT_TIME, $DT_IP, $TYPE, $_username, $_userid;
     $post['editor'] = $_username;
     $post['addtime'] = isset($post['addtime']) && $post['addtime'] ? strtotime($post['addtime']) : $DT_TIME;
     $post['adddate'] = timetodate($post['addtime'], 3);
     $post['edittime'] = $DT_TIME;
     $post['editdate'] = timetodate($post['edittime'], 3);
     $post['totime'] = $post['totime'] ? strtotime($post['totime'] . ' 23:59:59') : 0;
     $post['fee'] = dround($post['fee']);
     $post['total'] = intval($post['total']);
     $post['email'] = trim($post['email']);
     $post['minsalary'] = intval($post['minsalary']);
     $post['maxsalary'] = intval($post['maxsalary']);
     $post['type'] = intval($post['type']);
     $post['gender'] = intval($post['gender']);
     $post['education'] = intval($post['education']);
     $post['experience'] = intval($post['experience']);
     $post['minage'] = intval($post['minage']);
     $post['maxage'] = intval($post['maxage']);
     $post['title'] = trim($post['title']);
     $post['content'] = stripslashes($post['content']);
     $post['content'] = save_local($post['content']);
     if ($MOD['clear_link']) {
         $post['content'] = clear_link($post['content']);
     }
     if ($MOD['save_remotepic']) {
         $post['content'] = save_remote($post['content']);
     }
     if ($MOD['introduce_length']) {
         $post['introduce'] = addslashes(get_intro($post['content'], $MOD['introduce_length']));
     }
     if ($this->itemid) {
         $new = $post['content'];
         $r = $this->get_one();
         $old = $r['content'];
         delete_diff($new, $old);
     } else {
         $post['ip'] = $DT_IP;
     }
     $content = $post['content'];
     unset($post['content']);
     $post = dhtmlspecialchars($post);
     $post['content'] = addslashes(dsafe($content));
     return array_map("trim", $post);
 }
开发者ID:hcd2008,项目名称:destoon,代码行数:46,代码来源:job.class.php

示例15: captcha

if ($submit) {
    captcha($captcha);
    $email = trim($email);
    if (!is_email($email)) {
        message($L['sendmail_pass_mailto']);
    }
    $title = trim(stripslashes($title));
    if (strlen($title) < 5) {
        message($L['pass_title']);
    }
    $content = trim(stripslashes($content));
    if (strlen($content) < 10) {
        message($L['pass_content']);
    }
    clear_upload($content);
    $content = dsafe(save_local($content));
    $content = ob_template('send', 'mail');
    $DT['mail_name'] = $_company;
    if (send_mail($email, $title, $content, '', false)) {
        //$_email
        message(lang($L['sendmail_success'], array($email)), 'sendmail.php');
    } else {
        message($L['sendmail_fail']);
    }
} else {
    $head_title = $L['sendmail_title'];
    $email = isset($email) ? trim(stripslashes($email)) : '';
    $title = isset($title) ? trim(stripslashes($title)) : '';
    $content = isset($content) ? trim(stripslashes($content)) : '';
    if ($action == 'page' && isset($title) && isset($linkurl)) {
        $content = lang($L['sendmail_content'], array(userurl($_username), $_username, $title, $linkurl));
开发者ID:hcd2008,项目名称:destoon,代码行数:31,代码来源:sendmail.inc.php


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