From e2f5ecdbca0057f8560c189878a40b87a6b63fde Mon Sep 17 00:00:00 2001 From: origami11 Date: Mon, 23 Jan 2017 17:30:04 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A2=D0=B8=D0=BF=20=D0=BF=D0=B8=D1=81=D1=8C?= =?UTF-8?q?=D0=BC=D0=B0.=20=D0=AD=D0=BA=D1=80=D0=B0=D0=BD=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=B2=D1=8B?= =?UTF-8?q?=D1=87=D0=B5=D0=BA=20=D0=B2=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D1=81=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/database_pdo.php | 4 ++-- core/mail.php | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/core/database_pdo.php b/core/database_pdo.php index 21c1285..0c7770c 100644 --- a/core/database_pdo.php +++ b/core/database_pdo.php @@ -72,7 +72,7 @@ class Database extends PDO return $sth->fetch(); } - private static function assignQuote($x, $y) + private function assignQuote($x, $y) { return $x . "=" . $this->quote($y); } @@ -92,7 +92,7 @@ class Database extends PDO function updateQuery($table, array $values, $cond) { return $this->query("UPDATE $table SET " . implode(",", - array_map(array('self', 'assignQuote'), array_keys($values), array_values($values))) . " WHERE $cond"); + array_map(array($this, 'assignQuote'), array_keys($values), array_values($values))) . " WHERE $cond"); } function getIdGenerator() { diff --git a/core/mail.php b/core/mail.php index 53fa161..3bd2ef1 100644 --- a/core/mail.php +++ b/core/mail.php @@ -17,6 +17,7 @@ class Mail protected $attachment = array (); protected $uniqid; + protected $type = "text/plain"; function __construct() { $this->setEncoding("UTF-8"); @@ -70,6 +71,11 @@ class Mail $this->content = $text; } + function setType($type) + { + $this->type = $type; + } + /** * Кодировка текста в письме */ @@ -134,7 +140,7 @@ class Mail function getMessage() { $message = "--".$this->uniqid . PHP_EOL; - $message .= $this->mimeTag("Content-Type", "text/plain", array ('charset' => $this->encoding)); + $message .= $this->mimeTag("Content-Type", $this->type, array ('charset' => $this->encoding)); $message .= $this->mimeTag("Content-Transfer-Encoding", "8bit"); $message .= PHP_EOL . $this->content . PHP_EOL . PHP_EOL;