00001 <?php
00002
00003
00004
00005
00035
00036
00037
00038 if ($cfg['SQLValidator']['use'] == TRUE) {
00039 require_once('./libraries/sqlvalidator.class.php');
00040 }
00041
00042
00055 function PMA_validateSQL($sql)
00056 {
00057 global $cfg;
00058
00059 $str = '';
00060
00061 if ($cfg['SQLValidator']['use']) {
00062 if (isset($GLOBALS['sqlvalidator_error'])
00063 && $GLOBALS['sqlvalidator_error']) {
00064 $str = sprintf($GLOBALS['strValidatorError'], '<a href="./Documentation.html#faqsqlvalidator" target="documentation">', '</a>');
00065 } else {
00066
00067 $srv = new PMA_SQLValidator();
00068
00069
00070
00071
00072 if ($cfg['SQLValidator']['username'] != '') {
00073 $srv->setCredentials($cfg['SQLValidator']['username'], $cfg['SQLValidator']['password']);
00074 }
00075
00076
00077 $srv->appendCallingProgram('phpMyAdmin', PMA_VERSION);
00078
00079
00080 $srv->setTargetDbms('MySQL', PMA_MYSQL_STR_VERSION);
00081
00082
00083 $srv->start();
00084
00085
00086 $str = $srv->validationString($sql);
00087 }
00088
00089 }
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099 return $str;
00100 }
00101
00102 ?>