- if ((isset($SQLs)) && (is_array($SQLs)) && (!empty($SQLs[0]))) {
- if (strpos($SQLs[0], "INSERT") > -1) {
- $result = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE level='%s' LIMIT 1",
- array(bigintval($_POST['lvl'])), __FILE__, __LINE__);
+ if ((IS_SQLS_VALID()) && (IS_SQLS_VALID())) {
+ if (strpos($GLOBALS['sqls'][0], "INSERT") > -1) {
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE level='%s' LIMIT 1",
+ array(bigintval(REQUEST_POST('lvl'))), __FILE__, __LINE__);