Get Smarty

Smarty Icon

You may use the Smarty logo according to the trademark notice.

Smarty Template Engine Smarty Template Engine

For sponsorship, advertising, news or other inquiries, contact us at:

Check reviews of PHP Web Hosting, compatible with Smarty Templates

escape (Maskieren)

Parameter Position Typ Erforderlich Mögliche (erlaubte) Werte Standardwerte Beschreibung
1 string Nein html, htmlall, url, quotes, hex, hexentity, javascript html Definiert die zu verwendende Maskierung.

Wird verwendet um eine Variable mit HTML, URL oder einfachen Anführungszeichen, beziehungsweise Hex oder Hex-Entitäten zu maskieren. Hex und Hex-Entity kann verwendet werden um "mailto:" -Links so zu verändern, dass sie von Web-Spiders (E-Mail Sammlern) verborgen bleiben und dennoch les-/linkbar für Webbrowser bleiben. Als Standard, wird 'HTML'-Maskierung verwendet.

Example 5.11. escape (Maskieren)


<?php
index.php:

$smarty-&gt;assign('TitreArticle', "'Zwei Unbekannte haben im Lidl in Monheim 24 Pakete Kaffee gestohlen.'");
?>

   

Wobei im Template folgendes steht:


{$artikelTitel}
{$artikelTitel|escape}
{$artikelTitel|escape:"html"}    {* maskiert &amp; &quot; &#039; &lt; &gt; *}
{$artikelTitel|escape:"htmlall"} {* maskiert ALLE html Entit&auml;ten *}
{$artikelTitel|escape:"url"}
{$artikelTitel|escape:"quotes"}
&lt;a href="mailto:{$EmailAdresse|escape:"hex"}"&gt;{$EmailAdresse|escape:"hexentity"}&lt;/a&gt;

   

Ausgabe:


'Zwei Unbekannte haben im Lidl in Monheim 24 Pakete Kaffee gestohlen.'
&amp;#039;Zwei Unbekannte haben im Lidl in Monheim 24 Pakete Kaffee gestohlen.&amp;#039;
&amp;#039;Zwei Unbekannte haben im Lidl in Monheim 24 Pakete Kaffee gestohlen.&amp;#039;
&amp;#039;Zwei Unbekannte haben im Lidl in Monheim 24 Pakete Kaffee gestohlen.&amp;#039;
%27Zwei+Unbekannte+haben+im+Lidl+in+Monheim+24+Pakete+Kaffee+gestohlen.%27
\'Zwei Unbekannte haben im Lidl in Monheim 24 Pakete Kaffee gestohlen.\'
&lt;a href=&quot;mailto:%62%6f%62%40%6d%65%2e%6e%65%74&quot;&gt;&amp;#x62;&amp;#x6f;&amp;#x62;&amp;#x40;&amp;#x6d;&amp;#x65;&amp;#x2e;&amp;#x6e;&amp;#x65;&amp;#x74;&lt;/a&gt;

   

Siehe auch Smarty Parsing umgehen und Verschleierung von E-mail Adressen.

Comments
No comments for this page.
Post a Comment
All comments are moderated. Support questions are ignored, use the forums instead.
Author:
Email: (not shown)
What is 15 plus 10? (Are you human?)

Sponsors [info]

Cheap Website Hosting @hostdone.com
email marketing @ActiveCampaign
broadband deals @BroadbandGenie
Best UK Web Hosting @webhost.uk.net
Reliable UK and US Web Hosting @rshosting.com
Cheap US and UK Web Hosting @infrenion.com
I.T Certification Exams @pass-guaranteed.com
Certification Practice Tests @firsttrycertify.com
Certification Practice Exam Questions @ace-it-certifications.com
Broadband Speed Test @broadbandspeed.co.uk
bulk email software @americaint.com
ASP.NET hosting @aspnethosting.co.uk