Re: Extended escape modifier

From: Date: Fri, 29 Jun 2001 14:35:32 +0000
Subject: Re: Extended escape modifier
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-1100@lists.php.net to get a copy of this message
Andrei Zmievski wrote: > > On Fri, 29 Jun 2001, Monte Ohrt wrote: > > Ok, for now we'll just add the quote escapement. Now for the logic > > behind that: > > > > case 'quotes': > > // escape unescaped single quotes > > return preg_replace("%(?<!\\\\)'%", "\\'", > > $string); > > > > Does this look good? (only escape if not already escaped) > > Two things: > > 1. We are not going to escape double quotes? > Maybe create a separate one called dquotes? I don't think you would never want to escape both at the same time. > 2. What if you have a string "foo \\'this'" -- does this mean ' is > already escaped? Probably not. Can we adjust the regex to accomodate this? > > -Andrei > * I don't have a solution but I admire the problem. * > > --- > You are currently subscribed to smarty as: monte@ispi.net > To unsubscribe send a blank email to $subst('Email.Unsub') > Visit Smarty's homepage at > http://www.phpinsider.com/php/code/Smarty/ -- Monte Ohrt <monte@ispi.net> http://www.ispi.net/

« previous php.smarty.general (#1100) next »