Re: http://bugs.php.net/bugs.php?id=8409
| From: | Cynic | Date: | Mon, 08 Jan 2001 21:42:31 +0000 |
| Subject: | Re: http://bugs.php.net/bugs.php?id=8409 | ||
| References: | 1 2 3 4 5 6 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-43470@lists.php.net to get a copy of this message | ||
yes, I asked for a change in this some time ago. extract()
should check whether the _prefixed_ name is legal.
At 22:35 8.1. 2001, Stig Venaas wrote the following:
--------------------------------------------------------------
>On Mon, Jan 08, 2001 at 03:05:05PM -0600, Andrei Zmievski wrote:
>> On Mon, 08 Jan 2001, Stig Venaas wrote:
>> > Returning the number of variables sounds like a good idea then.
>> >
>> > If you agree this is good I could always try to implement it unless
>> > cynic or you wants to.
>>
>> It's been done. Maybe someone could update the docs as well.
>
>Great, I'll fix the doc.
>
>I see two problems with the extract() code. You check that the key
>is a legal variable name but not that prefix_key is. There are two
>problems with this.
>
>
>
>$a = array( '1a' => 'b' ) ;
>extract($a, EXTR_PREFIX_ALL , 'prefix') ;
>
>should set $prefix_1a but doesn't since '1a' isn't legal.
>
>
>
>and
>
>
>
>$a = array( 'a' => 'b' ) ;
>echo extract($a, EXTR_PREFIX_ALL , '1prefix') ;
>
>puts the key (variable) '1prefix_a' into the symbol table.
>
>Stig
------end of quote------
____________________________________________________________
Cynic:
A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.
cynic@mail.cz