diff --git a/ChangeLog b/ChangeLog index 7f6987e193..a9f03152f4 100755 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,7 @@ $Source$ * server_privileges.php3: Remove column privileges. * config.inc.php3: Added $cfg['DefaultTabServer']. * header.inc.php3: Link the default tabs. + * libraries/common.lib.php3: PHP3 compatibility. 2003-02-02 Michal Cihar * lang/czech: Updated. diff --git a/libraries/common.lib.php3 b/libraries/common.lib.php3 index a23fcfd15f..6163d9cf0d 100644 --- a/libraries/common.lib.php3 +++ b/libraries/common.lib.php3 @@ -1624,6 +1624,27 @@ if (typeof(document.getElementById) != 'undefined' } + if (!function_exists('in_array')) { + /** + * Searches $haystack for $needle and returns TRUE if it is found in + * the array, FALSE otherwise. + * + * @param mixed the 'needle' + * @param array the 'haystack' + * + * @return boolean has $needle been found or not? + */ + function in_array($needle, $haystack) { + while (list(, $value) = each($haystack)) { + if ($value == $haystack) { + return TRUE; + } + } + return FALSE; + } + } + + // Kanji encoding convert feature appended by Y.Kawada (2002/2/20) if (PMA_PHP_INT_VERSION >= 40006 && @function_exists('mb_convert_encoding')