libraries/sqlparser.lib.php3: checkType function

This commit is contained in:
Robin Johnson
2003-01-22 01:33:38 +00:00
parent a798255cf2
commit 1e04e222d0
2 changed files with 27 additions and 0 deletions

View File

@@ -5,6 +5,9 @@ phpMyAdmin - Changelog
$Id$
$Source$
2003-01-21 Robin Johnson <robbat2@users.sourceforge.net>
* libraries/sqlparser.lib.php3: checkType function
2003-01-21 Alexander M. Turek <rabus@users.sourceforge.net>
* lang/catalan-*.inc.php3: Updates, thanks to Xavier Navarro (xavin).

View File

@@ -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