The branch, master has been updated via 0a6f2823bd46fc3f486c0b1ef557c1e1284626ba (commit) via d5eba48036cc3a0d0afa3bda74d74b2f719677e1 (commit) via 2399c8a7843eb5016dd1222e0e309fec5cb59379 (commit) via b0496eb204e9ec02d9493ca462dabcfeccaf48c6 (commit) via 0e535038a1f343d2368c42b5d5840d9292fbe970 (commit) from fd493c6b4cff296646a9c9ea0d0eda6fbcf9a881 (commit)
- Log ----------------------------------------------------------------- commit 0a6f2823bd46fc3f486c0b1ef557c1e1284626ba Author: Piotr Przybylski piotrprz@gmail.com Date: Thu Jun 23 23:24:54 2011 +0200
Use utf8-aware PMA_strtolower
commit d5eba48036cc3a0d0afa3bda74d74b2f719677e1 Author: Piotr Przybylski piotrprz@gmail.com Date: Thu Jun 23 23:24:15 2011 +0200
Remove unused PMA_STR_rPos, add PMA_strtolower
commit 2399c8a7843eb5016dd1222e0e309fec5cb59379 Author: Piotr Przybylski piotrprz@gmail.com Date: Thu Jun 23 23:19:32 2011 +0200
Remove PMA_MULTIBYTE_ENCODING constant
commit b0496eb204e9ec02d9493ca462dabcfeccaf48c6 Author: Piotr Przybylski piotrprz@gmail.com Date: Thu Jun 23 21:05:42 2011 +0200
Fix comments
commit 0e535038a1f343d2368c42b5d5840d9292fbe970 Author: Piotr Przybylski piotrprz@gmail.com Date: Thu Jun 23 21:05:29 2011 +0200
Allow to drop database when AllowUserDropDatabase is true
-----------------------------------------------------------------------
Summary of changes: db_operations.php | 2 +- js/messages.php | 2 +- libraries/common.inc.php | 4 ---- libraries/string.lib.php | 2 +- libraries/string_mb.lib.php | 34 +++++++++++++--------------------- libraries/string_native.lib.php | 34 +++++++++++++--------------------- 6 files changed, 29 insertions(+), 49 deletions(-)
diff --git a/db_operations.php b/db_operations.php index 2e0244f..94f8575 100644 --- a/db_operations.php +++ b/db_operations.php @@ -47,7 +47,7 @@ if (strlen($db) && (! empty($db_rename) || ! empty($db_copy))) { // lower_case_table_names=1 `DB` becomes `db` $lower_case_table_names = PMA_DBI_fetch_value('SHOW VARIABLES LIKE "lower_case_table_names"', 0, 1); if ($lower_case_table_names === '1') { - $newname = strtolower($newname); + $newname = PMA_strtolower($newname); }
$local_query = 'CREATE DATABASE ' . PMA_backquote($newname); diff --git a/js/messages.php b/js/messages.php index 18cb752..7851a19 100644 --- a/js/messages.php +++ b/js/messages.php @@ -24,7 +24,7 @@ require_once './libraries/js_escape.lib.php';
$js_messages['strClickToSelect'] = __('Click to select'); $js_messages['strClickToUnselect'] = __('Click to unselect'); -$js_messages['strNoDropDatabases'] = __('"DROP DATABASE" statements are disabled.'); +$js_messages['strNoDropDatabases'] = $cfg['AllowUserDropDatabase'] ? '' : __('"DROP DATABASE" statements are disabled.');
/* For confirmations */ $js_messages['strDoYouReally'] = __('Do you really want to '); diff --git a/libraries/common.inc.php b/libraries/common.inc.php index 31c2194..8ccc7c0 100644 --- a/libraries/common.inc.php +++ b/libraries/common.inc.php @@ -784,10 +784,6 @@ if (! defined('PMA_MINIMUM_COMMON')) { if (function_exists('mb_convert_encoding') && $lang == 'ja') { require_once './libraries/kanji-encoding.lib.php'; - /** - * enable multibyte string support - */ - define('PMA_MULTIBYTE_ENCODING', 1); } // end if
/** diff --git a/libraries/string.lib.php b/libraries/string.lib.php index 96bfcfc..6c45a22 100644 --- a/libraries/string.lib.php +++ b/libraries/string.lib.php @@ -34,7 +34,7 @@ if ($GLOBALS['PMA_allow_mbstr']) { /** * Load proper code for handling input. */ -if (defined('PMA_MULTIBYTE_ENCODING') || $GLOBALS['PMA_allow_mbstr']) { +if ($GLOBALS['PMA_allow_mbstr']) { $GLOBALS['PMA_strpos'] = 'mb_strpos'; $GLOBALS['PMA_substr'] = 'mb_substr'; require './libraries/string_mb.lib.php'; diff --git a/libraries/string_mb.lib.php b/libraries/string_mb.lib.php index 69b5a0d..7b8e14b 100644 --- a/libraries/string_mb.lib.php +++ b/libraries/string_mb.lib.php @@ -18,11 +18,8 @@ /** * Returns length of string depending on current charset. * - * @uses mb_strlen() * @param string string to count * @return int string length - * @access public - * @todo rename to PM_STR_len() */ function PMA_strlen($string) { @@ -32,13 +29,10 @@ function PMA_strlen($string) /** * Returns substring from string, works depending on current charset. * - * @uses mb_substr() - * @param string string to count - * @param int start of substring - * @param int length of substring - * @return int substring - * @access public - * @todo rename to PM_STR_sub() + * @param string $string string to count + * @param int $start start of substring + * @param int $length length of substring + * @return string */ function PMA_substr($string, $start, $length = 2147483647) { @@ -46,29 +40,27 @@ function PMA_substr($string, $start, $length = 2147483647) }
/** - * returns postion of $needle in $haystack or false if not found + * Returns postion of $needle in $haystack or false if not found * - * @uses mb_strpos() - * @param string $needle * @param string $haystack + * @param string $needle + * @param int $offset * @return integer position of $needle in $haystack or false */ -function PMA_STR_pos($haystack, $needle, $offset = 0) +function PMA_strpos($haystack, $needle, $offset = 0) { return mb_strpos($haystack, $needle, $offset); }
/** - * returns right most postion of $needle in $haystack or false if not found + * Make a string lowercase * - * @uses mb_strrpos() - * @param string $needle - * @param string $haystack - * @return integer position of $needle in $haystack or false + * @param string $string + * @return string */ -function PMA_STR_rPos($haystack, $needle, $offset = 0) +function PMA_strtolower($string) { - return mb_strrpos($haystack, $needle, $offset); + return mb_strtolower($string); }
?> diff --git a/libraries/string_native.lib.php b/libraries/string_native.lib.php index e70bf0b..b07c315 100644 --- a/libraries/string_native.lib.php +++ b/libraries/string_native.lib.php @@ -18,11 +18,8 @@ /** * Returns length of string depending on current charset. * - * @uses strlen() * @param string string to count * @return int string length - * @access public - * @todo rename to PM_STR_len() */ function PMA_strlen($string) { @@ -32,13 +29,10 @@ function PMA_strlen($string) /** * Returns substring from string, works depending on current charset. * - * @uses substr() - * @param string string to count - * @param int start of substring - * @param int length of substring - * @return int substring - * @access public - * @todo rename to PM_STR_sub() + * @param string $string string to count + * @param int $start start of substring + * @param int $length length of substring + * @return string */ function PMA_substr($string, $start, $length = 2147483647) { @@ -46,29 +40,27 @@ function PMA_substr($string, $start, $length = 2147483647) }
/** - * returns postion of $needle in $haystack or false if not found + * Returns postion of $needle in $haystack or false if not found * - * @uses strpos() - * @param string $needle * @param string $haystack + * @param string $needle + * @param int $offset * @return integer position of $needle in $haystack or false */ -function PMA_STR_pos($haystack, $needle, $offset = 0) +function PMA_strpos($haystack, $needle, $offset = 0) { return strpos($haystack, $needle, $offset); }
/** - * returns right most postion of $needle in $haystack or false if not found + * Make a string lowercase * - * @uses strrpos() - * @param string $needle - * @param string $haystack - * @return integer position of $needle in $haystack or false + * @param string $string + * @return string */ -function PMA_STR_rPos($haystack, $needle, $offset = 0) +function PMA_strtolower($string) { - return strrpos($haystack, $needle, $offset); + return strtolower($string); }
?>
hooks/post-receive