From: Andreas Gohr Date: Mon, 18 Jun 2007 13:30:37 +0000 (+0200) Subject: reverted deafult modifier, added shortcut for manual escaping X-Git-Tag: 0.7.1~64 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=b8515ffc341bd21f37112e54d32dd480201bae28;p=contagged reverted deafult modifier, added shortcut for manual escaping Even the Smarty guys discourage the use of the deafualt_modifier. In fact variable escaping in smarty is a big mess :-/ darcs-hash:20070618133037-6e07b-f20040f5b58fe85d440ecf399f941152a347e1ef.gz --- diff --git a/init.php b/init.php index 657a1c6..3130292 100644 --- a/init.php +++ b/init.php @@ -39,5 +39,4 @@ $smarty->use_sub_dirs = 0; $smarty->template_dir = './templates'; $smarty->force_compile = $conf['smartycompile']; - $smarty->default_modifiers = 'escape:"htmlall":"UTF-8"'; ?> diff --git a/templates/entry_edit.tpl b/templates/entry_edit.tpl index 00453ca..8dad65b 100644 --- a/templates/entry_edit.tpl +++ b/templates/entry_edit.tpl @@ -2,14 +2,14 @@

{if $entry.type != ''} - + {/if} - {$entry.givenname} {$entry.name} + {$entry.givenname|h} {$entry.name|h}

- + @@ -20,19 +20,19 @@ {* always required ... if $fields.name *} - + {* /if *} {if $fields.givenname} - + {/if} {if $fields.title} - + {/if}
{$lang.name}:
{$lang.givenname}:
{$lang.title}:
@@ -56,70 +56,70 @@ {$lang.organization}: - + {/if} {if $fields.office} {$lang.office}: - + {/if} {if $fields.street} {$lang.street}: - + {/if} {if $fields.zip} {$lang.zip}: - + {/if} {if $fields.location} {$lang.location}: - + {/if} {if $fields.state} {$lang.state}: - + {/if} {if $fields.country} {$lang.country}: -
+
{/if} {if $fields.phone} {$lang.phone}: - + {/if} {if $fields.switchboard} {$lang.switchboard}: - + {/if} {if $fields.fax} {$lang.fax}: - + {/if} {if $fields.pager} {$lang.pager}: - + {/if} {if $fields.manager} @@ -136,13 +136,13 @@ {if $fields.position} {$lang.position}: - + {/if} {if $fields.department} {$lang.department}: - + {/if} @@ -158,25 +158,25 @@ {if $fields.homestreet} {$lang.homestreet}: - + {/if} {if $fields.homephone} {$lang.homephone}: - + {/if} {if $fields.mobile} {$lang.mobile}: - + {/if} {if $fields.url} {$lang.url}: - + {/if} {if $fields.photo} @@ -194,19 +194,19 @@ {if $fields.birthday} {$lang.birthday}:
({$lang.msg_dateformat}) - + {/if} {if $fields.anniversary} {$lang.anniversary}:
({$lang.msg_dateformat}) - + {/if} {if $fields.spouse} {$lang.spouse}: - + {/if} @@ -214,7 +214,7 @@ {$lang.communication} {if $fields._mail} - {foreach from=$entry.mail item=mail} + {foreach from=$entry.mail|smarty:nodefaults item=mail} {$lang.mail} {counter}: @@ -232,13 +232,13 @@ {if $fields.instantmessenger} {$lang.instantmessenger}: - + {/if} {if $fields.ipphone} {$lang.ipphone}: - + {/if} @@ -260,14 +260,14 @@ {$lang.marker}:
({$lang.msg_tagsep}) - + {/if} {if $fields.note} {$lang.note}: - + {/if} @@ -279,7 +279,7 @@ {$lang.certificate}: - +
@@ -287,14 +287,14 @@ {if $fields.domain} {$lang.domain}: - + {/if} {if $fields.timezone} {$lang.timezone}: -
+
{/if} diff --git a/templates/entry_show.tpl b/templates/entry_show.tpl index 3f0c5f2..fa794bd 100644 --- a/templates/entry_show.tpl +++ b/templates/entry_show.tpl @@ -1,14 +1,14 @@ {include file="header.tpl"} {if $entry.photo != ''} - + {/if}

- - {$entry.givenname} {$entry.name} + + {$entry.givenname|h} {$entry.name|h}

- +
{else} diff --git a/templates/list_entry.tpl b/templates/list_entry.tpl index a6d7d55..29e64a0 100644 --- a/templates/list_entry.tpl +++ b/templates/list_entry.tpl @@ -1,23 +1,23 @@ {if $entry.type}
{$lang.business} @@ -16,24 +16,24 @@ @@ -41,25 +41,25 @@ {if $entry.phone} - + {/if} {if $entry.switchboard} - + {/if} {if $entry.fax} - + {/if} {if $entry.pager} - + {/if} {if $managername} @@ -71,13 +71,13 @@ {if $entry.position} - + {/if} {if $entry.department} - + {/if} @@ -94,46 +94,46 @@
- {$entry.title} {$entry.givenname} {$entry.name}
+ {$entry.title|h} {$entry.givenname|h} {$entry.name|h}
{if $entry.organization} - {$entry.organization}
+ {$entry.organization|h}
{/if} {if $entry.office} - {$entry.office}
+ {$entry.office|h}
{/if} {if $entry.street} - {$entry.street}
+ {$entry.street|h}
{/if} {if $entry.location} - {$entry.zip} {$entry.location}
+ {$entry.zip} {$entry.location|h}
{/if} {if $entry.state} - {$entry.state} + {$entry.state|h} {/if} {if $entry.country} - {$entry.country} + {$entry.country|h} {/if}

{$lang.phone}:{$entry.phone}{$entry.phone|h}
{$lang.switchboard}:{$entry.switchboard}{$entry.switchboard|h}
{$lang.fax}:{$entry.fax}{$entry.fax|h}
{$lang.pager}:{$entry.pager}{$entry.pager|h}
{$lang.position}:{$entry.position}{$entry.position|h}
{$lang.department}:{$entry.department}{$entry.department|h}
{if $entry.homephone} - + {/if} {if $entry.mobile} - + {/if} {if $entry.url} - + {/if} {if $entry.birthday} - + {/if} {if $entry.anniversary} - + {/if} {if $entry.spouse} - + {/if} @@ -148,7 +148,7 @@ @@ -156,13 +156,13 @@ {if $entry.instantmessenger} - + {/if} {if $entry.ipphone} - + {/if} @@ -189,7 +189,7 @@ {/if} {if $entry.domain} - + {/if} {if $entry.timezone} - + {/if}
- {$entry.title} {$entry.givenname} {$entry.name}
+ {$entry.title} {$entry.givenname} {$entry.name|h}
{if $entry.homestreet} - {$entry.homestreet|nl2br}

+ {$entry.homestreet|h|nl2br}

{/if}
{$lang.homephone}:{$entry.homephone}{$entry.homephone|h}
{$lang.mobile}:{$entry.mobile}{$entry.mobile|h}
{$lang.url}:{$entry.url}{$entry.url|h}
{$lang.birthday}:{$entry.birthday}{$entry.birthday|h}
{$lang.anniversary}:{$entry.anniversary|date_format:$conf.dateformat}{$entry.anniversary|date_format:$conf.dateformat|h}
{$lang.spouse}:{$entry.spouse}{$entry.spouse|h}
{$lang.mail}: {foreach from=$entry.mail item=mail} - {$mail}
+ {$mail|h}
{/foreach}
{$lang.instantmessenger}:{$entry.instantmessenger}{$entry.instantmessenger|h}
{$lang.ipphone}:{$entry.ipphone}{$entry.ipphone|h}
{foreach from=$entry.marker item=marker} - {$marker} + {$marker|h} {/foreach} {if $user} @@ -226,20 +226,20 @@
{$lang.certificate}: - +
{$lang.domain}:{$entry.domain}{$entry.domain|h}
{$lang.timezone}:{$entry.timezone}{$entry.timezone|h}
diff --git a/templates/list.tpl b/templates/list.tpl index 99acd01..f1e28ad 100644 --- a/templates/list.tpl +++ b/templates/list.tpl @@ -4,7 +4,7 @@ {if $conf.userlogreq == 1 && $user == ''}
- {* include un truc *} {$lang.msg_login} + {$lang.msg_login}
- + - {$entry.name}, {$entry.givenname} + {$entry.name|h}, {$entry.givenname|h} - {$entry.organization}  + {$entry.organization|h}  - {$entry.phone}  + {$entry.phone|h}  - {$entry.mail[0]}  + {$entry.mail[0]|h}  {if $entry.photo} - + {else}   {/if}