1
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2025-08-07 17:42:53 +03:00

functions.inc.php

- encode_header(): made charset parameter optional, defaults to utf-8
- db_delete(): escape_string() $where and $delete

create-mailbox.php:
- always encode mail header and insert Content-Type etc. headers
  (previous code never did this, $PALANG['charset'] is not set in any
  language. so this code part was never used)

sendmail.php:
- always encode mail header and insert Content-Type etc. headers
  (had the same bug as create-mailbox.php)
- merge GET and POST

These changes fix
http://sourceforge.net/tracker/index.php?func=detail&aid=1811214&group_id=191583&atid=937964



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@199 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
Christian Boltz
2007-11-04 22:52:16 +00:00
parent c47222ac14
commit a00d456084
3 changed files with 23 additions and 43 deletions

View File

@@ -900,7 +900,7 @@ function get_admin_properties ($username)
// Action: Encode a string according to RFC 1522 for use in headers if it contains 8-bit characters.
// Call: encode_header (string header, string charset)
//
function encode_header ($string, $default_charset)
function encode_header ($string, $default_charset = "utf-8")
{
if (strtolower ($default_charset) == 'iso-8859-1')
{
@@ -1514,7 +1514,7 @@ function db_assoc ($result)
//
function db_delete ($table,$where,$delete)
{
$result = db_query ("DELETE FROM $table WHERE $where='$delete'");
$result = db_query ("DELETE FROM $table WHERE " . escape_string($where) . "='" . escape_string($delete) . "'");
if ($result['rows'] >= 1)
{
return $result['rows'];