1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 01:24:17 +02:00

Allow specifying external links (bug #3392685)

This commit is contained in:
Jakub Vrana
2013-01-10 17:59:43 -08:00
parent 61dc40a512
commit f6e1c589f9
6 changed files with 37 additions and 3 deletions

View File

@@ -185,6 +185,14 @@ username.form['auth[driver]'].onchange();
return $rows;
}
/** Get a link to use in select table
* @param string raw value of the field
* @param array single field returned from fields()
* @return string or null to create the default link
*/
function selectLink($val, $field) {
}
/** Value printed in select table
* @param string HTML-escaped value to print
* @param string link to foreign key

View File

@@ -384,9 +384,9 @@ if (!$columns) {
}
}
}
if (!$link) {
if (is_mail($val)) {
$link = "mailto:$val";
if (!$link && ($link = $adminer->selectLink($row[$key], $field)) === null) {
if (is_mail($row[$key])) {
$link = "mailto:$row[$key]";
}
if ($protocol = is_url($row[$key])) {
$link = ($protocol == "http" && $HTTPS