mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 23:57:29 +02:00
E-mail sending
Change Adminer class to adminer_ functions.inc.php Unify includes Unify adminer_credentials() Don't use JUSH in Editor Separate identifier and description in breadcrumb Simplify where() git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@800 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
@@ -73,7 +73,7 @@ function where($where) {
|
||||
$key = bracket_escape($key, "back");
|
||||
$return[] = (preg_match('~^[A-Z0-9_]+\\(`(?:[^`]+|``)+`\\)$~', $key) ? $key : idf_escape($key)) . " IS NULL";
|
||||
}
|
||||
return $return;
|
||||
return implode(" AND ", $return);
|
||||
}
|
||||
|
||||
function where_check($val) {
|
||||
@@ -100,10 +100,9 @@ function redirect($location, $message = null) {
|
||||
|
||||
function query_redirect($query, $location, $message, $redirect = true, $execute = true, $failed = false) {
|
||||
global $dbh, $error, $SELF;
|
||||
$id = "sql-" . count($_SESSION["messages"]);
|
||||
$sql = "";
|
||||
if ($query) {
|
||||
$sql = " <a href='#$id' onclick=\"return !toggle('$id');\">" . lang('SQL command') . "</a><span id='$id' class='hidden'><pre class='jush-sql'>" . htmlspecialchars($query) . '</pre><a href="' . htmlspecialchars($SELF . 'sql=&history=' . count($_SESSION["history"][$_GET["server"]][$_GET["db"]])) . '">' . lang('Edit') . '</a></span>';
|
||||
$sql = adminer_message_query($query);
|
||||
$_SESSION["history"][$_GET["server"]][$_GET["db"]][] = $query;
|
||||
}
|
||||
if ($execute) {
|
||||
@@ -367,3 +366,26 @@ function dump_csv($row) {
|
||||
}
|
||||
echo implode(",", $row) . "\n";
|
||||
}
|
||||
|
||||
function is_email($email) {
|
||||
$atom = '[-a-z0-9!#$%&\'*+/=?^_`{|}~]'; // characters of local-name
|
||||
$domain = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])'; // one domain component
|
||||
return eregi("^$atom+(\\.$atom+)*@($domain?\\.)+$domain\$", $email);
|
||||
}
|
||||
|
||||
function email_header($header) {
|
||||
return chunk_split("=?UTF-8?B?" . base64_encode($header), 67, "\n "); // iconv_mime_encode requires PHP 5, imap_8bit requires IMAP extension
|
||||
}
|
||||
|
||||
function call_adminer($method, $default, $arg1 = null, $arg2 = null) {
|
||||
static $adminer;
|
||||
if (!isset($adminer)) {
|
||||
$adminer = (class_exists('Adminer') ? new Adminer : false); // user defined class
|
||||
}
|
||||
// maintains original method name in minification
|
||||
if (method_exists($adminer, $method)) {
|
||||
// can use func_get_args() and call_user_func_array()
|
||||
return $adminer->$method($arg1, $arg2);
|
||||
}
|
||||
return $default; //! $default is evaluated even if not neccessary
|
||||
}
|
||||
|
Reference in New Issue
Block a user