diff --git a/ChangeLog b/ChangeLog index e70c84719..7b56e41ab 100755 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,12 @@ $Id$ $Source$ +2002-10-25 Loïc Chapeaux + * libraries/common.lib.php3; libraries/display_tbl.lib.php3; + libraries/kanji-encoding.lib.php3; libraries/sqlparser.lib.php3 + libraries/string.lib.php3; user_password.php3: coding standards. + * libraries/auth/cookie.auth.php3: fixes a PHP3 bug. + 2002-10-25 Marc Delisle * Documentation.html, clarification about using Relation View diff --git a/libraries/common.lib.php3 b/libraries/common.lib.php3 index c651ed02d..9264af8ba 100644 --- a/libraries/common.lib.php3 +++ b/libraries/common.lib.php3 @@ -1497,7 +1497,7 @@ if (typeof(document.getElementById) != 'undefined' && strpos(' ' . $lang, 'ja-') && file_exists('./libraries/kanji-encoding.lib.php3')) { include('./libraries/kanji-encoding.lib.php3'); - define('PMA_MULTIBYTE_ENCODING',1); + define('PMA_MULTIBYTE_ENCODING', 1); } // end if } // $__PMA_COMMON_LIB__ diff --git a/libraries/display_tbl.lib.php3 b/libraries/display_tbl.lib.php3 index badb74ca3..724bbdbfa 100644 --- a/libraries/display_tbl.lib.php3 +++ b/libraries/display_tbl.lib.php3 @@ -577,11 +577,10 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) { $is_in_sort = FALSE; } else { //$is_in_sort = eregi('[[:space:]](`?)' . str_replace('\\', '\\\\', $fields_meta[$i]->name) . '(`?)[ ,$]', $sql_order); - $pattern = str_replace('\\', '\\\\', $fields_meta[$i]->name); - $pattern = str_replace('(','\(', $pattern); - $pattern = str_replace(')','\)', $pattern); + $pattern = str_replace('\\', '\\\\', $fields_meta[$i]->name); + $pattern = str_replace('(', '\(', $pattern); + $pattern = str_replace(')', '\)', $pattern); $is_in_sort = eregi('[[:space:]](`?)' . $pattern . '(`?)[ ,$]', $sql_order); - } // 2.1.3 Checks if the table name is required (it's the case // for a query with a "JOIN" statement and if the column @@ -608,15 +607,15 @@ if (!defined('PMA_DISPLAY_TBL_LIB_INCLUDED')) { $cfg['Order'] = (eregi('time|date', $fields_meta[$i]->type)) ? 'DESC' : 'ASC'; } $sort_order .= $cfg['Order']; - $order_img = ''; + $order_img = ''; } else if (eregi('[[:space:]]ASC$', $sql_order)) { $sort_order .= ' DESC'; - $order_img = ' '. $GLOBALS['strAscending'] . ''; + $order_img = ' '. $GLOBALS['strAscending'] . ''; } else if (eregi('[[:space:]]DESC$', $sql_order)) { $sort_order .= ' ASC'; - $order_img = ' '. $GLOBALS['strDescending'] . ''; + $order_img = ' '. $GLOBALS['strDescending'] . ''; } if (eregi('(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|LOCK IN SHARE MODE))', $unsorted_sql_query, $regs3)) { $sorted_sql_query = $regs3[1] . $sort_order . $regs3[2]; diff --git a/libraries/kanji-encoding.lib.php3 b/libraries/kanji-encoding.lib.php3 index e6486bbdc..d67fb736b 100644 --- a/libraries/kanji-encoding.lib.php3 +++ b/libraries/kanji-encoding.lib.php3 @@ -149,6 +149,5 @@ if (!defined('PMA_ENCODING_LIB_INCLUDED')) { PMA_internal_enc_check(); - } // $__PMA_ENCODING_LIB_INCLUDED ?> diff --git a/libraries/sqlparser.lib.php3 b/libraries/sqlparser.lib.php3 index 51a2d22fc..8bdbe0ac3 100644 --- a/libraries/sqlparser.lib.php3 +++ b/libraries/sqlparser.lib.php3 @@ -490,45 +490,45 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) { if ($arraysize > 0) { - $t_next = $sql_array[0]['type']; - $t_prev = ''; - $t_cur = ''; + $t_next = $sql_array[0]['type']; + $t_prev = ''; + $t_cur = ''; } for ($i = 0; $i < $arraysize; $i++) { - $t_prev = $t_cur; - $t_cur = $t_next; - if (($i + 1) < $arraysize) { - $t_next = $sql_array[$i + 1]['type']; - } else { - $t_next = ''; - } - if ($t_cur == 'alpha') { - $t_suffix = '_identifier'; - $d_cur_upper = strtoupper($sql_array[$i]['data']); - if (($t_next == 'punct_qualifier') || ($t_prev == 'punct_qualifier')) { - $t_suffix = '_identifier'; - } else if (($t_next == 'punct_bracket_open_round') - && PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_function_name, $PMA_SQPdata_function_name_cnt)) { - $t_suffix = '_functionName'; - } else if (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_column_type, $PMA_SQPdata_column_type_cnt)) { - $t_suffix = '_columnType'; - //temporary fix for BUG #621357 - //TODO FIX PROPERLY NEEDS OVERHAUL OF SQL TOKENIZER - if($d_cur_upper == 'SET' && $t_next != 'punct_bracket_open_round') { - $t_suffix = '_reservedWord'; - } - //END OF TEMPORARY FIX - } else if (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_reserved_word, $PMA_SQPdata_reserved_word_cnt)) { - $t_suffix = '_reservedWord'; - } else if (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_column_attrib, $PMA_SQPdata_column_attrib_cnt)) { - $t_suffix = '_columnAttrib'; + $t_prev = $t_cur; + $t_cur = $t_next; + if (($i + 1) < $arraysize) { + $t_next = $sql_array[$i + 1]['type']; } else { - // Do nothing + $t_next = ''; } - $sql_array[$i]['type'] .= $t_suffix; - } - } + if ($t_cur == 'alpha') { + $t_suffix = '_identifier'; + $d_cur_upper = strtoupper($sql_array[$i]['data']); + if (($t_next == 'punct_qualifier') || ($t_prev == 'punct_qualifier')) { + $t_suffix = '_identifier'; + } else if (($t_next == 'punct_bracket_open_round') + && PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_function_name, $PMA_SQPdata_function_name_cnt)) { + $t_suffix = '_functionName'; + } else if (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_column_type, $PMA_SQPdata_column_type_cnt)) { + $t_suffix = '_columnType'; + // Temporary fix for BUG #621357 + // TODO FIX PROPERLY NEEDS OVERHAUL OF SQL TOKENIZER + if ($d_cur_upper == 'SET' && $t_next != 'punct_bracket_open_round') { + $t_suffix = '_reservedWord'; + } + // END OF TEMPORARY FIX + } else if (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_reserved_word, $PMA_SQPdata_reserved_word_cnt)) { + $t_suffix = '_reservedWord'; + } else if (PMA_STR_binarySearchInArr($d_cur_upper, $PMA_SQPdata_column_attrib, $PMA_SQPdata_column_attrib_cnt)) { + $t_suffix = '_columnAttrib'; + } else { + // Do nothing + } + $sql_array[$i]['type'] .= $t_suffix; + } + } // end for // Stores the size of the array inside the array, as count() is a slow // operation. diff --git a/libraries/string.lib.php3 b/libraries/string.lib.php3 index a2e57bb78..1edee15aa 100644 --- a/libraries/string.lib.php3 +++ b/libraries/string.lib.php3 @@ -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) diff --git a/user_password.php3 b/user_password.php3 index 453f4e178..ffd0876db 100644 --- a/user_password.php3 +++ b/user_password.php3 @@ -107,13 +107,13 @@ $chg_evt_handler = (PMA_USR_BROWSER_AGENT == 'IE' && PMA_USR_BROWSER_VER >= 5) // Displays the form ?>
+ +
- -