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


PHP sql_regcase函數代碼示例

本文整理匯總了PHP中sql_regcase函數的典型用法代碼示例。如果您正苦於以下問題:PHP sql_regcase函數的具體用法?PHP sql_regcase怎麽用?PHP sql_regcase使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: foreach

echo $title;
?>
</h2>
<p>
The following unit tests are available:
<ul>
	<li>ProjectControllerTest tests the VM module's main project controller.</li>
	<li>ValidationTest tests the VM module's input validation functions, such as dates and times.</li>
	<li>daoTest tests database queries.</li>
</ul>
Click on the name of a test to run it. Click on the link next to a test to view its source code.<br />
<i>Note:</i> the database tests are very query-intensive, and refreshing quickly can lead to concurrency issues with our
current setup. Please click once and wait for the test to complete.
</p>
<?php 
foreach (glob(sql_regcase("*test*")) as $file) {
    if (stristr($file, 'test') && !stristr('RunTest.php,TestIncludes.php', $file)) {
        $name = str_replace('.php', '', $file);
        echo "<a href=\"RunTest.php?test={$name}\">{$name}</a> ";
        echo "<small>(<a href=\"RunTest.php?source={$name}\">view unit test source</a>)</small><br />";
    }
}
?>
<br />
<form action="RunTest" method="get">
	<label for="test">Test name: </label>
	<input type="text" name="test" id="test" value="<?php 
echo $test;
?>
"/>
	<input type="submit" value="Run" />
開發者ID:hasshy,項目名稱:sahana-tw,代碼行數:31,代碼來源:RunTest.php

示例2: cleanSqlCommands

 static function cleanSqlCommands($string)
 {
     $string = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\\*|--|\\\\)/"), "", $string);
     $string = strip_tags($string);
     $string = get_magic_quotes_gpc() ? $string : addslashes($string);
     return $string;
 }
開發者ID:rafaelcaviquioli,項目名稱:php-clean-request,代碼行數:7,代碼來源:PhpCleanRequest.php

示例3: anti_injection

function anti_injection($sql)
{
    $sql = preg_replace(sql_regcase("/(table|or|from|select|insert|delete|where|drop table|like|show tables|\\'|'\\| |=|-|;|,|\\|'|<|>|#|\\*|--|\\\\)/"), "", $sql);
    $sql = trim($sql);
    $sql = strip_tags($sql);
    $sql = get_magic_quotes_gpc() ? $sql : addslashes($sql);
    return $sql;
}
開發者ID:mix376,項目名稱:biverr,代碼行數:8,代碼來源:xss.php

示例4: removerSQLInjection

 public function removerSQLInjection($strTexto)
 {
     @($strTexto = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|\\*|--|\\\\)/"), "", $strTexto));
     @($strTexto = trim($strTexto));
     // @$strTexto = strip_tags($strTexto);
     //@$strTexto = addslashes($strTexto);
     return $strTexto;
 }
開發者ID:lucasmichel,項目名稱:cartorioOnline,代碼行數:8,代碼來源:SegurancaHelper.php

示例5: fetchAll

 /**
  * retourne la liste des films trouvés
  * @return array
  */
 public function fetchAll()
 {
     $pattern = $this->_path . DIRECTORY_SEPARATOR . '*.{' . $this->_extensions . '}';
     $t = array();
     foreach (glob(sql_regcase($pattern), GLOB_BRACE) as $file) {
         // sql_regcase pour matcher avi et AVI
         $t[] = new Default_Model_Film($file);
     }
     return $t;
 }
開發者ID:ka2er,項目名稱:mmc,代碼行數:14,代碼來源:FilmMapper.php

示例6: antiSQL

function antiSQL($string)
{
    if ($string == NULL) {
        return $string;
    }
    if (get_magic_quotes_gpc() == 0) {
        $string = addslashes($string);
    }
    preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\\*|--|\\\\)/"), "", $string);
    $string = strip_tags($string);
    return $string;
}
開發者ID:GolfinhoPvP,項目名稱:lokorez,代碼行數:12,代碼來源:funcoes.php

示例7: antiSqlInjection4

 public static function antiSqlInjection4($str)
 {
     # Remove palavras suspeitas de injection.
     $str = preg_replace(sql_regcase("/(\n|\r|%0a|%0d|Content-Type:|bcc:|to:|cc:|Autoreply:|from|select|insert|delete|where|drop table|show tables|#|\\*|--|\\\\)/"), "", $str);
     $str = trim($str);
     # Remove espaços vazios.
     $str = strip_tags($str);
     # Remove tags HTML e PHP.
     $str = addslashes($str);
     # Adiciona barras invertidas à uma string.
     return $str;
 }
開發者ID:cityware,項目名稱:city-security,代碼行數:12,代碼來源:AntiInjection.php

示例8: anti_injection

function anti_injection($sql)
{
    // remove palavras que contenham sintaxe sql
    $sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\\*|--|\\\\)/"), "", $sql);
    $sql = trim($sql);
    //limpa espaços vazio
    $sql = strip_tags($sql);
    //tira tags html e php
    $sql = addslashes($sql);
    //Adiciona barras invertidas a uma string
    return $sql;
}
開發者ID:lucasoares,項目名稱:webzohcaserver,代碼行數:12,代碼來源:layout.php

示例9: BitcoinAddressCheck

function BitcoinAddressCheck($UserInput)
{
    if (preg_match("/[^A-Za-z0-9]/", $UserInput)) {
        return "password";
    } else {
        $UserInput = $UserInput;
        $UserInput = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\\*|--|\\\\)/"), "", $UserInput);
        $UserInput = trim($UserInput);
        $UserInput = strip_tags($UserInput);
        $UserInput = get_magic_quotes_gpc() ? $UserInput : addslashes($UserInput);
        return $UserInput;
    }
}
開發者ID:ZenJB,項目名稱:TXZone,代碼行數:13,代碼來源:SQLProtect.php

示例10: _doFilter

 /**
  * DoFilter
  * 
  * @param  mixed $value
  * @param  array $modes
  * @return mixed
  * @static
  * @since  1.0
  */
 protected static function _doFilter($value, $mode)
 {
     switch ($mode) {
         case 'html':
             $value = strip_tags($value);
             $value = addslashes($value);
             $value = htmlspecialchars($value);
             break;
         case 'sql':
             $value = preg_replace(sql_regcase('/(from|select|insert|delete|where|drop table|show tables|#|\\*| |\\\\)/'), '', $value);
             $value = trim($value);
             break;
     }
     return $value;
 }
開發者ID:valodiapilquevitch,項目名稱:Relatorio-de-alunos,代碼行數:24,代碼來源:sanitize.php

示例11: _sql_regcase

 /**
  * Compatible function, supporting PHP7+, because:
  * http://php.net/sql_regcase   !Warning! This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.
  */
 function _sql_regcase($str)
 {
     if (function_exists('sql_regcase')) {
         return sql_regcase($str);
     }
     $res = '';
     $chars = str_split($str);
     foreach ($chars as $char) {
         if (preg_match('/[A-Za-z]/', $char)) {
             $res .= '[' . mb_strtoupper($char, 'UTF-8') . mb_strtolower($char, 'UTF-8') . ']';
         } else {
             $res .= $char;
         }
     }
     return $res;
 }
開發者ID:yfix,項目名稱:yf,代碼行數:20,代碼來源:yf_dir.class.php

示例12: anti_inject

function anti_inject($campo)
{
    foreach ($campo as $key => $val) {
        //remove words that contains syntax sql
        $val = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|\\*|--|\\\\)/"), "", $val);
        //Remove empty spaces
        $val = trim($val);
        //Removes tags html/php
        $val = strip_tags($val);
        //Add inverted bars to a string
        $val = addslashes($val);
        // store it back into the array
        $campo[$key] = $val;
    }
    return $campo;
    //Returns the the var clean
}
開發者ID:Rizwan1738,項目名稱:Mafia-Game-Script,代碼行數:17,代碼來源:globals.php

示例13: getAvailableCultures

 /**
  * @static
  * @return array
  */
 public static function getAvailableCultures()
 {
     //FCKeditor's available languages
     $fck = self::getFCKeditorsLanguages();
     //Prado's available languages
     $prado = CultureInfo::getCultures();
     //Gets the intersection through comparison
     $intersection = array();
     foreach ($prado as $p) {
         foreach ($fck as $f) {
             if (eregi("^" . sql_regcase($p) . "\$", str_replace('-', '_', $f))) {
                 $intersection[$p] = $f;
             }
         }
     }
     unset($fck, $prado);
     //Include languages that were not included, but are available.
     $intersection['ja'] = 'jp';
     $intersection['ja_JP'] = 'jp';
     $intersection['ja_JP_TRADITIONAL'] = 'jp';
     return $intersection;
 }
開發者ID:quantrocket,項目名稱:planlogiq,代碼行數:26,代碼來源:CSHtmlAreaConfigCollection.php

示例14: highlight

function highlight($text, $keyval)
{
    global $ssearch;
    $txt = $text;
    $hicolor = array('#FFFF66', '#ADD8E6', '#90EE8A', '#FF99FF');
    $keys = array();
    $keys = !is_array($keyval) ? array($keyval) : $keyval;
    foreach ($keys as $key) {
        if (mb_strlen($key[0]) > 0) {
            $key[0] = stripslashes($key[0]);
            if (isset($ssearch['ignore_specchar']) && $ssearch['ignore_specchar'] == 'on') {
                $case = $ssearch['ignore_case'] == 'on' ? '/i' : '/';
                $txt = preg_replace('/' . recode2regexp_utf8($key[0]) . $case, '<span style="background:' . $hicolor[$key[1]] . '" >\\0</span>', $txt);
            } else {
                if (!isset($ssearch['ignore_specchar']) || $ssearch['ignore_specchar'] == '') {
                    $case = $ssearch['ignore_case'] == 'on' ? '/i' : '/';
                    $txt = preg_replace('/' . $key[0] . $case, '<span style="background:' . $hicolor[$key[1]] . '" >\\0</span>', $txt);
                } else {
                    $txt = preg_replace('/' . sql_regcase($key[0]) . '/i', '<span style="background:' . $hicolor[$key[1]] . '" >\\0</span>', $txt);
                }
            }
        }
    }
    return $txt;
}
開發者ID:222elm,項目名稱:dotprojectFrame,代碼行數:25,代碼來源:smartsearch.class.php

示例15: pagegenInit

    /**
     * Setting some vars in TSFE, primarily based on TypoScript config settings.
     *
     * @return	void
     */
    public static function pagegenInit()
    {
        if ($GLOBALS['TSFE']->page['content_from_pid'] > 0) {
            $temp_copy_TSFE = clone $GLOBALS['TSFE'];
            // make REAL copy of TSFE object - not reference!
            $temp_copy_TSFE->id = $GLOBALS['TSFE']->page['content_from_pid'];
            // Set ->id to the content_from_pid value - we are going to evaluate this pid as was it a given id for a page-display!
            $temp_copy_TSFE->getPageAndRootlineWithDomain($GLOBALS['TSFE']->config['config']['content_from_pid_allowOutsideDomain'] ? 0 : $GLOBALS['TSFE']->domainStartPage);
            $GLOBALS['TSFE']->contentPid = intval($temp_copy_TSFE->id);
            unset($temp_copy_TSFE);
        }
        if ($GLOBALS['TSFE']->config['config']['MP_defaults']) {
            $temp_parts = t3lib_div::trimExplode('|', $GLOBALS['TSFE']->config['config']['MP_defaults'], 1);
            foreach ($temp_parts as $temp_p) {
                list($temp_idP, $temp_MPp) = explode(':', $temp_p, 2);
                $temp_ids = t3lib_div::intExplode(',', $temp_idP);
                foreach ($temp_ids as $temp_id) {
                    $GLOBALS['TSFE']->MP_defaults[$temp_id] = $temp_MPp;
                }
            }
        }
        // Global vars...
        $GLOBALS['TSFE']->indexedDocTitle = $GLOBALS['TSFE']->page['title'];
        $GLOBALS['TSFE']->debug = '' . $GLOBALS['TSFE']->config['config']['debug'];
        // Base url:
        if ($GLOBALS['TSFE']->config['config']['baseURL']) {
            if ($GLOBALS['TSFE']->config['config']['baseURL'] === '1') {
                // Deprecated property, going to be dropped.
                $error = 'Unsupported TypoScript property was found in this template: "config.baseURL="1"

This setting has been deprecated in TYPO 3.8.1 due to security concerns.
You need to change this value to the URL of your website root, otherwise TYPO3 will not work!

See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.typo3.org/index.php/TYPO3_3.8.1</a> for more information.';
                $GLOBALS['TSFE']->printError(nl2br($error));
                exit;
            } else {
                $GLOBALS['TSFE']->baseUrl = $GLOBALS['TSFE']->config['config']['baseURL'];
            }
            $GLOBALS['TSFE']->anchorPrefix = substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'), strlen(t3lib_div::getIndpEnv('TYPO3_SITE_URL')));
        }
        // Internal and External target defaults
        $GLOBALS['TSFE']->intTarget = '' . $GLOBALS['TSFE']->config['config']['intTarget'];
        $GLOBALS['TSFE']->extTarget = '' . $GLOBALS['TSFE']->config['config']['extTarget'];
        $GLOBALS['TSFE']->fileTarget = '' . $GLOBALS['TSFE']->config['config']['fileTarget'];
        if ($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses'] === 'ascii') {
            $GLOBALS['TSFE']->spamProtectEmailAddresses = 'ascii';
        } else {
            $GLOBALS['TSFE']->spamProtectEmailAddresses = t3lib_div::intInRange($GLOBALS['TSFE']->config['config']['spamProtectEmailAddresses'], -10, 10, 0);
        }
        $GLOBALS['TSFE']->absRefPrefix = $GLOBALS['TSFE']->config['config']['absRefPrefix'] ? trim($GLOBALS['TSFE']->config['config']['absRefPrefix']) : '';
        if ($GLOBALS['TSFE']->type && $GLOBALS['TSFE']->config['config']['frameReloadIfNotInFrameset']) {
            $tdlLD = $GLOBALS['TSFE']->tmpl->linkData($GLOBALS['TSFE']->page, '_top', $GLOBALS['TSFE']->no_cache, '');
            $GLOBALS['TSFE']->JSCode = 'if(!parent.' . trim($GLOBALS['TSFE']->sPre) . ' && !parent.view_frame) top.location.href="' . $GLOBALS['TSFE']->baseUrlWrap($tdlLD['totalURL']) . '"';
        }
        $GLOBALS['TSFE']->compensateFieldWidth = '' . $GLOBALS['TSFE']->config['config']['compensateFieldWidth'];
        $GLOBALS['TSFE']->lockFilePath = '' . $GLOBALS['TSFE']->config['config']['lockFilePath'];
        $GLOBALS['TSFE']->lockFilePath = $GLOBALS['TSFE']->lockFilePath ? $GLOBALS['TSFE']->lockFilePath : $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'];
        $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_noScaleUp'] = isset($GLOBALS['TSFE']->config['config']['noScaleUp']) ? '' . $GLOBALS['TSFE']->config['config']['noScaleUp'] : $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_noScaleUp'];
        $GLOBALS['TSFE']->TYPO3_CONF_VARS['GFX']['im_noScaleUp'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_noScaleUp'];
        $GLOBALS['TSFE']->ATagParams = trim($GLOBALS['TSFE']->config['config']['ATagParams']) ? ' ' . trim($GLOBALS['TSFE']->config['config']['ATagParams']) : '';
        if ($GLOBALS['TSFE']->config['config']['setJS_mouseOver']) {
            $GLOBALS['TSFE']->setJS('mouseOver');
        }
        if ($GLOBALS['TSFE']->config['config']['setJS_openPic']) {
            $GLOBALS['TSFE']->setJS('openPic');
        }
        $GLOBALS['TSFE']->sWordRegEx = '';
        $GLOBALS['TSFE']->sWordList = t3lib_div::_GP('sword_list');
        if (is_array($GLOBALS['TSFE']->sWordList)) {
            $standAlone = trim('' . $GLOBALS['TSFE']->config['config']['sword_standAlone']);
            $noMixedCase = trim('' . $GLOBALS['TSFE']->config['config']['sword_noMixedCase']);
            $space = $standAlone ? '[[:space:]]' : '';
            foreach ($GLOBALS['TSFE']->sWordList as $val) {
                if (trim($val)) {
                    if (!$noMixedCase) {
                        $GLOBALS['TSFE']->sWordRegEx .= $space . sql_regcase(quotemeta($val)) . $space . '|';
                    } else {
                        $GLOBALS['TSFE']->sWordRegEx .= $space . quotemeta($val) . $space . '|';
                    }
                }
            }
            $GLOBALS['TSFE']->sWordRegEx = preg_replace('/\\|$/', '', $GLOBALS['TSFE']->sWordRegEx);
        }
        // linkVars
        $linkVars = (string) $GLOBALS['TSFE']->config['config']['linkVars'];
        if ($linkVars) {
            $linkVarArr = explode(',', $linkVars);
            $GLOBALS['TSFE']->linkVars = '';
            $GET = t3lib_div::_GET();
            foreach ($linkVarArr as $val) {
                $val = trim($val);
                if (preg_match('/^(.*)\\((.+)\\)$/', $val, $match)) {
                    $val = trim($match[1]);
                    $test = trim($match[2]);
//.........這裏部分代碼省略.........
開發者ID:zsolt-molnar,項目名稱:TYPO3-4.5-trunk,代碼行數:101,代碼來源:class.tslib_pagegen.php


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