当前位置: 首页>>代码示例>>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;未经允许,请勿转载。