This commit is contained in:
Jakub Vrana 2017-02-19 14:32:01 +01:00
parent 9df33e82e6
commit 346353153d

View file

@ -431,9 +431,9 @@ function create_routine($routine, $row) {
}
/** Remove current user definer from SQL command
* @param string
* @return string
*/
* @param string
* @return string
*/
function remove_definer($query) {
return preg_replace('~^([A-Z =]+) DEFINER=`' . preg_replace('~@(.*)~', '`@`(%|\\1)', logged_user()) . '`~', '\\1', $query); //! proper escaping of user
}