0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 19:22:14 +02:00

(basically the same as in r200, this time for users/vacation.php)

users/vacation.php
- fix double-encoded special characters if language file contains
  entity-encoded strings by html_entity_decode'ing the string
  (will be encoded in template file later)

users_vacation.tpl:
- encode tSubject with htmlentities() in template


git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@209 a1433add-5e2c-0410-b055-b7f2511e0802
This commit is contained in:
Christian Boltz 2007-11-11 23:08:58 +00:00
parent 3aa9032cd9
commit 5cf48d6cb5
2 changed files with 10 additions and 7 deletions

View File

@ -6,7 +6,7 @@
</tr>
<tr>
<td><?php print $PALANG['pUsersVacation_subject'] . ":"; ?></td>
<td><input type="text" name="fSubject" value="<?php print $tSubject; ?>" /></td>
<td><input type="text" name="fSubject" value="<?php print htmlentities($tSubject, ENT_QUOTES, 'UTF-8'); ?>" /></td>
<td>&nbsp;</td>
</tr>
<tr>
@ -31,3 +31,4 @@
</table>
</form>
</div>
<?php /* vim: set ft=php expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?>

View File

@ -42,7 +42,7 @@ if($CONF['vacation'] == 'NO') {
exit(0);
}
$tmp = preg_split ('/@/', $USERID_USERNAME);
$tmp = preg_split ('/@/', $USERID_USERNAME);
$USERID_DOMAIN = $tmp[1];
if ($_SERVER['REQUEST_METHOD'] == "GET")
@ -56,10 +56,10 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
$tBody = $row['body'];
}
if ($tSubject == '') { $tSubject = $PALANG['pUsersVacation_subject_text']; }
if ($tBody == '') { $tBody = $PALANG['pUsersVacation_body_text']; }
if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); }
if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); }
$template = "users_vacation.tpl";
$template = "users_vacation.tpl";
include ("../templates/header.tpl");
include ("../templates/users_menu.tpl");
@ -85,8 +85,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
if (isset ($_POST['fBack'])) $fBack = escape_string ($_POST['fBack']);
//set a default, reset fields for coming back selection
if ($tSubject == '') { $tSubject = $PALANG['pUsersVacation_subject_text']; }
if ($tBody == '') { $tBody = $PALANG['pUsersVacation_body_text']; }
if ($tSubject == '') { $tSubject = html_entity_decode($PALANG['pUsersVacation_subject_text'], ENT_QUOTES, 'UTF-8'); }
if ($tBody == '') { $tBody = html_entity_decode($PALANG['pUsersVacation_body_text'], ENT_QUOTES, 'UTF-8'); }
// if they've set themselves away OR back, delete any record of vacation emails.
if (!empty ($fBack) || !empty ($fAway))
@ -184,4 +184,6 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
include ("../templates/users_vacation.tpl");
include ("../templates/footer.tpl");
}
/* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */
?>