當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Sanitize::CleanStr方法代碼示例

本文整理匯總了PHP中Sanitize::CleanStr方法的典型用法代碼示例。如果您正苦於以下問題:PHP Sanitize::CleanStr方法的具體用法?PHP Sanitize::CleanStr怎麽用?PHP Sanitize::CleanStr使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Sanitize的用法示例。


在下文中一共展示了Sanitize::CleanStr方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getCountryFromIP

    $country = getCountryFromIP($host, "CTRY");
    $now .= " <img src=" . CSS_PATH . "flags/" . strtolower($country) . ".png /> ";
}
$c_name = $name;
$c_email = $email;
if (strpos($email, 'sage') !== false || strpos($email, 'nokosage') !== false) {
    $sageThis = true;
}
if (strpos($email, 'nokosage') !== false || strpos($email, 'noko') !== false) {
    $noko = true;
}
require_once "tripcode.php";
//This DOES the trip processing.
//Text sanitizing
//Text plastic surgery (rorororor)
$email = $sanitize->CleanStr($email, 0);
//Don't allow moderators to fuck with this
$email = preg_replace("[\r\n]", "", $email);
$sub = $sanitize->CleanStr($sub, 0);
//Or this
$sub = preg_replace("[\r\n]", "", $sub);
$url = $sanitize->CleanStr($url, 0);
//Or this
$url = preg_replace("[\r\n]", "", $url);
$resto = $sanitize->CleanStr($resto, 0);
//Or this
$resto = preg_replace("[\r\n]", "", $resto);
$com = $sanitize->CleanStr($com, $moderator);
//But they can with this.
$clean = $sanitize->process($name, $com, $sub, $email, $resto, $url, $dest, $moderator);
if (USE_BBCODE === true) {
開發者ID:Bossgod,項目名稱:3ch,代碼行數:31,代碼來源:regist.php

示例2: substr

            $idsalt = $idsalt + 1;
        } else {
            $idsalt = $resto;
        }
        $now .= " (ID:" . $idhtml . substr(crypt(md5($_SERVER["REMOTE_ADDR"] . PANEL_PASS . 'id' . date("Ymd", $time)), $idsalt), +3) . "</span>)";
    }
}
if (COUNTRY_FLAGS && file_exists('geoiploc.php')) {
    require_once CORE_DIR . "/regist/geoiploc.php";
    $country = getCountryFromIP($host, "CTRY");
    $now .= " <img src=" . CSS_PATH . "flags/" . strtolower($country) . ".png /> ";
}
$c_name = $clean['name'];
$c_email = $clean['email'];
//Text plastic surgery (rorororor)
$clean['email'] = $sanitize->CleanStr($clean['email'], 0);
//Don't allow moderators to fuck with this
$clean['email'] = preg_replace("[\r\n]", "", $clean['email']);
$clean['sub'] = $sanitize->CleanStr($clean['sub'], 0);
//Or this
$clean['sub'] = preg_replace("[\r\n]", "", $clean['sub']);
$url = $sanitize->CleanStr($url, 0);
//Or this
$url = preg_replace("[\r\n]", "", $url);
$resto = $sanitize->CleanStr($resto, 0);
//Or this
$resto = preg_replace("[\r\n]", "", $resto);
$clean['com'] = $sanitize->CleanStr($clean['com'], $moderator);
//But they can with this.
if (USE_BBCODE === true) {
    require_once CORE_DIR . '/general/text_process/bbcode.php';
開發者ID:ru4chan,項目名稱:yotsubato,代碼行數:31,代碼來源:regist.php


注:本文中的Sanitize::CleanStr方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。