[pmwiki-users] ZAP error message...

The Editor editor at fast.st
Fri Oct 27 14:11:32 CDT 2006


On 10/27/06, Crisses <crisses at kinhost.org> wrote:
>
>
> On Oct 27, 2006, at 1:24 PM, The Editor wrote:
>
> Another little bug.  This line gives me an error message:
>
>  foreach ($p as $pp) $_POST[$pp] = preg_replace('&#x3a;)', '/\:\)/',
> $_POST[$pp]);
>
>
>
> The first parameter in this is supposed to be the search, the second is the
> replace parameter.
>
> The search parameter needs to be delimited by some character.  Whatever you
> use as the first character -- in this case '&' is expected to show "pattern
> start...pattern end" -- but & happens only once, so the pattern never ends.
>
> usually people use /..../ as in:
> '/searchforthis/'
>
> Your second parameter looks like it might be the search parameter?
>
>  foreach ($p as $pp) $_POST[$pp] = preg_replace('/\:\)/',
> '&#x3a;)',
> $_POST[$pp]);
>
> Crisses


Actually this is the right order.  I'm trying to take stuff that has
already been disabled and reenabling it.  IE:  change "&#x3a;)" to
":)"

But this helps me begin to get a hint of why there are all those /\ \
/ things in the search patterns. Could you help me fix this to work?
Maybe:

  foreach ($p as $pp) $_POST[$pp] = preg_replace('/\&#x3a;\)/', ':)' );

Cheers,
Caveman




More information about the pmwiki-users mailing list