Coding standards

This commit is contained in:
Loïc Chapeaux
2002-10-25 13:55:56 +00:00
parent ee8c06cd56
commit 78f4c7f06d
7 changed files with 63 additions and 60 deletions

View File

@@ -19,19 +19,20 @@
if (!defined('PMA_STR_LIB_INCLUDED')) {
define('PMA_STR_LIB_INCLUDED', 1);
//this is for handling input better
if(defined('PMA_MULTIBYTE_ENCODING')) {
$GLOBALS['PMA_strlen'] = 'mb_strlen';
$GLOBALS['PMA_strpos'] = 'mb_strpos';
$GLOBALS['PMA_strrpos'] = 'mb_strrpos';
$GLOBALS['PMA_substr'] = 'mb_substr';
// This is for handling input better
if (defined('PMA_MULTIBYTE_ENCODING')) {
$GLOBALS['PMA_strlen'] = 'mb_strlen';
$GLOBALS['PMA_strpos'] = 'mb_strpos';
$GLOBALS['PMA_strrpos'] = 'mb_strrpos';
$GLOBALS['PMA_substr'] = 'mb_substr';
} else {
$GLOBALS['PMA_strlen'] = 'strlen';
$GLOBALS['PMA_strpos'] = 'strpos';
$GLOBALS['PMA_strrpos'] = 'strrpos';
$GLOBALS['PMA_substr'] = 'substr';
$GLOBALS['PMA_strlen'] = 'strlen';
$GLOBALS['PMA_strpos'] = 'strpos';
$GLOBALS['PMA_strrpos'] = 'strrpos';
$GLOBALS['PMA_substr'] = 'substr';
}
/**
* This checks if a string actually exists inside another string
* We try to do it in a PHP3-portable way.
@@ -242,9 +243,8 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
/**
* Checks if a character is an accented character
*
* @note Presently this only works for some
* character sets. More work may be
* needed to fix it.
* @note Presently this only works for some character sets. More work
* may be needed to fix it.
*
* @param string character to check for
*
@@ -255,14 +255,13 @@ if (!defined('PMA_STR_LIB_INCLUDED')) {
*/
function PMA_STR_isAccented($c)
{
$ord_min1 = 192; //ord('A');
$ord_max1 = 214; //ord('Z');
$ord_min2 = 216; //ord('A');
$ord_max2 = 246; //ord('Z');
$ord_min3 = 248; //ord('A');
$ord_max3 = 255; //ord('Z');
$ord_c = ord($c);
return PMA_STR_numberInRangeInclusive($ord_c, $ord_min1, $ord_max1)