mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
Adds relevant Charset: statement to email templates that need don't have it.
git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@2586 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
74a1d5ed27
commit
999480b9fd
1 changed files with 73 additions and 0 deletions
73
phpBB/develop/encoding_emails.php
Normal file
73
phpBB/develop/encoding_emails.php
Normal file
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
/***************************************************************************
|
||||
* revar_lang_files.php
|
||||
* -------------------
|
||||
* begin : Saturday, Feb 13, 2001
|
||||
* copyright : (C) 2001 The phpBB Group
|
||||
* email : support@phpbb.com
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
***************************************************************************/
|
||||
|
||||
//
|
||||
// Security message:
|
||||
//
|
||||
// This script is potentially dangerous.
|
||||
// Remove or comment the next line (die(".... ) to enable this script.
|
||||
// Do NOT FORGET to either remove this script or disable it after you have used it.
|
||||
//
|
||||
die("Please read the first lines of this script for instructions on how to enable it");
|
||||
|
||||
$dirname = "./../language";
|
||||
$dir = opendir($dirname);
|
||||
|
||||
while ( $file = readdir($dir) )
|
||||
{
|
||||
if ( ereg('^lang_', $file) && !is_file($dirname . '/' . $file) && !is_link($dirname . '/' . $file) )
|
||||
{
|
||||
include($dirname . '/' . $file . '/lang_main.php');
|
||||
|
||||
$lang_dir = opendir($dirname . '/' . $file . '/email');
|
||||
|
||||
while ( $email = readdir($lang_dir) )
|
||||
{
|
||||
if ( ereg('\.tpl$', $email) && is_file($dirname . '/' . $file . '/email/' . $email) )
|
||||
{
|
||||
$fp = fopen($dirname . '/' . $file . '/email/' . $email, 'r+');
|
||||
|
||||
$email_file = "";
|
||||
while ( $line = fread($fp, 100000) )
|
||||
{
|
||||
$email_file .= $line;
|
||||
}
|
||||
|
||||
if ( !preg_match('/^Charset: .*?$/m', $email_file) )
|
||||
{
|
||||
$email_file = preg_replace('/^((Subject: .*?\n)(\n))?/i', "\\2Charset: " . $lang['ENCODING'] . "\n\n", $email_file);
|
||||
}
|
||||
|
||||
echo '<b>' . $dirname . '/' . $file . '/email/' . $email . "</b><br />\n";
|
||||
echo nl2br($email_file);
|
||||
echo "\n\n<br /><br />\n\n";
|
||||
|
||||
fseek($fp, 0);
|
||||
fwrite($fp, $email_file);
|
||||
fclose($fp);
|
||||
}
|
||||
}
|
||||
echo "\n\n<hr />\n\n";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Reference in a new issue