diff --git a/ChangeLog b/ChangeLog index 02341ddca..526690547 100755 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ phpMyAdmin - Changelog $Id$ $Source$ +2003-01-21 Robin Johnson + * libraries/sqlparser.lib.php3: checkType function + 2003-01-21 Alexander M. Turek * lang/catalan-*.inc.php3: Updates, thanks to Xavier Navarro (xavin). diff --git a/libraries/sqlparser.lib.php3 b/libraries/sqlparser.lib.php3 index 14d7b820a..ebbe7b43f 100644 --- a/libraries/sqlparser.lib.php3 +++ b/libraries/sqlparser.lib.php3 @@ -594,6 +594,30 @@ if (!defined('PMA_SQP_LIB_INCLUDED')) { return $sql_array; } // end of the "PMA_SQP_parse()" function + /** + * Checks for token types being what we want... + * + * @param string String of type that we have + * @param string String of type that we want + * + * @return boolean result of check + * + * @access private + */ + function PMA_SQP_typeCheck($toCheck, $whatWeWant) + { + $typeSeperator = '_'; + if(strcmp($whatWeWant, $toCheck) == 0) { + return TRUE; + } else { + if(strpos($whatWeWant, $typeSeperator) === FALSE) { + return strncmp($whatWeWant, $toCheck , strpos($toCheck, $typeSeperator)) == 0; + } else { + return FALSE; + } + } + } + /** * Analyzes SQL queries