1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-16 11:34:10 +02:00

Remove definer from routine and event

This commit is contained in:
Jakub Vrana
2012-08-09 09:39:12 -07:00
parent ca32e71e42
commit a4e38a266d
3 changed files with 11 additions and 3 deletions

View File

@@ -574,7 +574,7 @@ username.form['auth[driver]'].onchange();
}
if ($is_view) {
// remove DEFINER with current user
$create = preg_replace('~^([A-Z =]+) DEFINER=`' . preg_replace('~@(.*)~', '`@`(%|\\1)', logged_user()) . '`~', '\\1', $create); //! proper escaping of user
$create = remove_definer($create);
}
echo ($style != "CREATE+ALTER" ? $create : ($is_view ? substr_replace($create, " OR REPLACE", 6, 0) : substr_replace($create, " IF NOT EXISTS", 12, 0))) . ";\n\n";
}