diff --git a/libraries/common.lib.php b/libraries/common.lib.php
index 40523f831a..dfa68e657a 100644
--- a/libraries/common.lib.php
+++ b/libraries/common.lib.php
@@ -3734,14 +3734,15 @@ function PMA_getFunctionsForField($field, $insert_mode)
// For compatibility's sake, do not let out all other functions. Instead
// print a separator (blank) and then show ALL functions which weren't
// shown yet.
- $cnt_functions = count($cfg['Functions']);
+ $functions = $GLOBALS['PMA_Types']->getAllFunctions();
+ $cnt_functions = count($functions);
for ($j = 0; $j < $cnt_functions; $j++) {
- if (! isset($dropdown_built[$cfg['Functions'][$j]])
- || $dropdown_built[$cfg['Functions'][$j]] != 'true'
+ if (! isset($dropdown_built[$functions[$j]])
+ || $dropdown_built[$functions[$j]] != 'true'
) {
// Is current function defined as default?
- $selected = ($field['first_timestamp'] && $cfg['Functions'][$j] == $cfg['DefaultFunctions']['first_timestamp'])
- || (! $field['first_timestamp'] && $cfg['Functions'][$j] == $default_function)
+ $selected = ($field['first_timestamp'] && $functions[$j] == $cfg['DefaultFunctions']['first_timestamp'])
+ || (! $field['first_timestamp'] && $functions[$j] == $default_function)
? ' selected="selected"'
: '';
if ($op_spacing_needed == true) {
@@ -3751,7 +3752,7 @@ function PMA_getFunctionsForField($field, $insert_mode)
}
$retval .= ' ';
- $retval .= '' . "\n";
}
} // end for
diff --git a/libraries/rte/rte_routines.lib.php b/libraries/rte/rte_routines.lib.php
index f52ebad0f4..6955ba9c4d 100644
--- a/libraries/rte/rte_routines.lib.php
+++ b/libraries/rte/rte_routines.lib.php
@@ -1143,6 +1143,7 @@ function PMA_RTN_handleExecute()
$queries = array();
$end_query = array();
$args = array();
+ $all_functions = $GLOBALS['PMA_Types']->getAllFunctions();
for ($i=0; $i<$routine['item_num_params']; $i++) {
if (isset($_REQUEST['params'][$routine['item_param_name'][$i]])) {
$value = $_REQUEST['params'][$routine['item_param_name'][$i]];
@@ -1151,7 +1152,7 @@ function PMA_RTN_handleExecute()
}
$value = PMA_sqlAddSlashes($value);
if (! empty($_REQUEST['funcs'][$routine['item_param_name'][$i]])
- && in_array($_REQUEST['funcs'][$routine['item_param_name'][$i]], $cfg['Functions'])
+ && in_array($_REQUEST['funcs'][$routine['item_param_name'][$i]], $all_functions)
) {
$queries[] = "SET @p$i={$_REQUEST['funcs'][$routine['item_param_name'][$i]]}('$value');\n";
} else {