Rename functions (avoid conflict with WordPress)
This commit is contained in:
parent
207673f06c
commit
1cf374bf48
|
@ -730,7 +730,7 @@ function password_file() {
|
||||||
* @param string
|
* @param string
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function is_email($email) {
|
function is_mail($email) {
|
||||||
$atom = '[-a-z0-9!#$%&\'*+/=?^_`{|}~]'; // characters of local-name
|
$atom = '[-a-z0-9!#$%&\'*+/=?^_`{|}~]'; // characters of local-name
|
||||||
$domain = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])'; // one domain component
|
$domain = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])'; // one domain component
|
||||||
$pattern = "$atom+(\\.$atom+)*@($domain?\\.)+$domain";
|
$pattern = "$atom+(\\.$atom+)*@($domain?\\.)+$domain";
|
||||||
|
|
|
@ -279,7 +279,7 @@ if (!$columns) {
|
||||||
if (isset($names[$key])) {
|
if (isset($names[$key])) {
|
||||||
$field = $fields[$key];
|
$field = $fields[$key];
|
||||||
if ($val != "" && (!isset($email_fields[$key]) || $email_fields[$key] != "")) {
|
if ($val != "" && (!isset($email_fields[$key]) || $email_fields[$key] != "")) {
|
||||||
$email_fields[$key] = (is_email($val) ? $names[$key] : ""); //! filled e-mails can be contained on other pages
|
$email_fields[$key] = (is_mail($val) ? $names[$key] : ""); //! filled e-mails can be contained on other pages
|
||||||
}
|
}
|
||||||
$link = "";
|
$link = "";
|
||||||
$val = $adminer->editVal($val, $field);
|
$val = $adminer->editVal($val, $field);
|
||||||
|
@ -322,7 +322,7 @@ if (!$columns) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!$link) {
|
if (!$link) {
|
||||||
if (is_email($val)) {
|
if (is_mail($val)) {
|
||||||
$link = "mailto:$val";
|
$link = "mailto:$val";
|
||||||
}
|
}
|
||||||
if ($protocol = is_url($row[$key])) {
|
if ($protocol = is_url($row[$key])) {
|
||||||
|
|
|
@ -358,7 +358,7 @@ ORDER BY ORDINAL_POSITION", null, "") as $row) { //! requires MySQL 5
|
||||||
$replace['{$' . "$val}"] = $this->editVal($row[$val], $fields[$val]);
|
$replace['{$' . "$val}"] = $this->editVal($row[$val], $fields[$val]);
|
||||||
}
|
}
|
||||||
$email = $row[$_POST["email_field"]];
|
$email = $row[$_POST["email_field"]];
|
||||||
if (is_email($email) && send_email($email, strtr($subject, $replace), strtr($message, $replace), $_POST["email_from"], $_FILES["email_files"])) {
|
if (is_mail($email) && send_mail($email, strtr($subject, $replace), strtr($message, $replace), $_POST["email_from"], $_FILES["email_files"])) {
|
||||||
$sent++;
|
$sent++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ function email_header($header) {
|
||||||
* @param array
|
* @param array
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
function send_email($email, $subject, $message, $from = "", $files = array()) {
|
function send_mail($email, $subject, $message, $from = "", $files = array()) {
|
||||||
$eol = (strncasecmp(PHP_OS, "win", 3) ? "\n" : "\r\n"); // PHP_EOL available since PHP 4.3.10 and 5.0.2
|
$eol = (strncasecmp(PHP_OS, "win", 3) ? "\n" : "\r\n"); // PHP_EOL available since PHP 4.3.10 and 5.0.2
|
||||||
$message = str_replace("\n", $eol, wordwrap(str_replace("\r", "", "$message\n")));
|
$message = str_replace("\n", $eol, wordwrap(str_replace("\r", "", "$message\n")));
|
||||||
$boundary = uniqid("boundary");
|
$boundary = uniqid("boundary");
|
||||||
|
|
Loading…
Reference in a new issue