Re: [PHP-DEV] month part

2002-12-20 Thread Diana Castillo
Hi everyone, I really wanted to validate if they put in a date , I ended up
doing it like this:
list($month, $day, $year) = sscanf($lastcontact,%d/%d/%d);
if (checkdate($month,$day,$year)){it is a date}

Antony Dovgal [EMAIL PROTECTED] escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Thu, 19 Dec 2002 15:04:56 +0100
 Diana Castillo [EMAIL PROTECTED] wrote:

  How can I get a string containing the month part of a date the user
types
  in?
  e.g. if they type in 06/07/200 I want to get 06
 Take a look to http://php.net/explode, String Functions and Date/Time
Functions.
 But you'd better write such questions to [EMAIL PROTECTED]

 ---
 Wbr,
 Antony Dovgal aka tony2001 mailto:[EMAIL PROTECTED]
 http://phpclub.net



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] RC4 and PHP_AUTH_USER

2002-12-20 Thread Phil Driscoll
Andrei said he wants to roll RC4 today. Can someone take a look at
http://bugs.php.net/bug.php?id=20441
which is marked as critical for 4.3.0.

Thanks
-- 
Phil Driscoll

--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Re: #21060 [Opn-Bgs]: range() gives warning and returns false whenlow == high

2002-12-20 Thread Derick Rethans
On 20 Dec 2002 [EMAIL PROTECTED] wrote:

  ID:   21060
  Updated by:   [EMAIL PROTECTED]
  Reported By:  [EMAIL PROTECTED]
 -Status:   Open
 +Status:   Bogus
  Bug Type: Arrays related
  Operating System: Linux 2.4.18
  PHP Version:  4CVS-2002-12-16 (dev)
  New Comment:
 
 Thank you for taking the time to write to us, but this is not
 a bug. Please double-check the documentation available at
 http://www.php.net/manual/ and the instructions on how to report
 a bug at http://bugs.php.net/how-to-report.php
 
 Nothing wrong with this behaviour, the low  high point are the same,
 hence the false output indicating failure.

Actually, I think this is a bug, and I see the usefulnes in having the 
floor and bottom having the same value. I can write up a patch if 
needed.

Derick

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 JDI Media Solutions http://www.jdimedia.nl/
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] CGI and CLI (compromise proposal)

2002-12-20 Thread Andrei Zmievski
On Fri, 20 Dec 2002, Marcus Börger wrote:
 What about uniqid(): http://www.zend.com/zend/week/week116.php#Heading5
 
 I would go for disabling when not available and sending an error
 when calling from cygwin without more entropy parameter set to
 true. The rest can be fixed for 4.3.1 as it seems to late for a fix
 in 4.3.0.

Fine with me.

-Andrei   http://www.gravitonic.com/

The day Microsoft makes something that doesn't suck, 
is probably the day Microsoft starts making vacuum cleaners.
- Ernst Jan Plugge

--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: #21060 [Opn-Bgs]: range() gives warning andreturns false when low == high

2002-12-20 Thread Derick Rethans
On Fri, 20 Dec 2002, Andrei Zmievski wrote:

 Let's postpone this until 4.3.1. It is not critical.

I didn't say it was; I was just saying that I think it shouldn't be 
bogus :)

Derick


 
 On Fri, 20 Dec 2002, Derick Rethans wrote:
  On 20 Dec 2002 [EMAIL PROTECTED] wrote:
  
ID:   21060
Updated by:   [EMAIL PROTECTED]
Reported By:  [EMAIL PROTECTED]
   -Status:   Open
   +Status:   Bogus
Bug Type: Arrays related
Operating System: Linux 2.4.18
PHP Version:  4CVS-2002-12-16 (dev)
New Comment:
   
   Thank you for taking the time to write to us, but this is not
   a bug. Please double-check the documentation available at
   http://www.php.net/manual/ and the instructions on how to report
   a bug at http://bugs.php.net/how-to-report.php
   
   Nothing wrong with this behaviour, the low  high point are the same,
   hence the false output indicating failure.
  
  Actually, I think this is a bug, and I see the usefulnes in having the 
  floor and bottom having the same value. I can write up a patch if 
  needed.
  
  Derick
  
  -- 
  
  -
   Derick Rethans http://derickrethans.nl/ 
   JDI Media Solutions http://www.jdimedia.nl/
   PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
  -
  
  
  -- 
  PHP Development Mailing List http://www.php.net/
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 -Andrei   http://www.gravitonic.com/
 * Black holes are where God divided by zero. *
 

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] 4.3 + gzip-encoding

2002-12-20 Thread Marcus Börger
Hi,

i just have installed latest php 4.3 on linux and windows.
I use the same directory and therefore .htaccess files for
apache/mod_php on both platforms.

When i enable enable output compression with
php_value zlib.output_compression On
in .htaccess the linux version works as expected but the
windows version fails. Sometimes i receive errors with
access violations. Sometimes i can downlowd the result
but when rename the resulting file to .gz i can open it and
as you might expect it contains the correct result.

marcus




--
Marcus Börger - Looking for all sorts of freelance work - just ask...

Did i help you? Consider a gift:
http://www.amazon.de/exec/obidos/wishlist/ho722v0rg1u0
--



[PHP-DEV] Re: #21060 [Opn-Bgs]: range() gives warning and returns false when low == high

2002-12-20 Thread Ilia A.
On December 20, 2002 06:35 am, you wrote:
 On 20 Dec 2002 [EMAIL PROTECTED] wrote:
   ID:   21060
   Updated by:   [EMAIL PROTECTED]
   Reported By:  [EMAIL PROTECTED]
  -Status:   Open
  +Status:   Bogus
   Bug Type: Arrays related
   Operating System: Linux 2.4.18
   PHP Version:  4CVS-2002-12-16 (dev)
   New Comment:
 
  Thank you for taking the time to write to us, but this is not
  a bug. Please double-check the documentation available at
  http://www.php.net/manual/ and the instructions on how to report
  a bug at http://bugs.php.net/how-to-report.php
 
  Nothing wrong with this behaviour, the low  high point are the same,
  hence the false output indicating failure.

 Actually, I think this is a bug, and I see the usefulnes in having the
 floor and bottom having the same value. I can write up a patch if
 needed.

What would be an output then, array() ?

Ilia 

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: #21060 [Opn-Bgs]: range() gives warning andreturns false when low == high

2002-12-20 Thread Derick Rethans
On Fri, 20 Dec 2002, Ilia A. wrote:

 On December 20, 2002 06:35 am, you wrote:
  
   Thank you for taking the time to write to us, but this is not
   a bug. Please double-check the documentation available at
   http://www.php.net/manual/ and the instructions on how to report
   a bug at http://bugs.php.net/how-to-report.php
  
   Nothing wrong with this behaviour, the low  high point are the same,
   hence the false output indicating failure.
 
  Actually, I think this is a bug, and I see the usefulnes in having the
  floor and bottom having the same value. I can write up a patch if
  needed.
 
 What would be an output then, array() ?

range(2,4) gives  array(2,3,4);
range(2,3) gives  array(2,3);
range(2,2) gives  array(2);

Derick

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: #21060 [Opn-Bgs]: range() gives warning and returns false when low == high

2002-12-20 Thread Ilia A.
On December 20, 2002 09:37 am, you wrote:
 On Fri, 20 Dec 2002, Ilia A. wrote:
  On December 20, 2002 06:35 am, you wrote:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php
   
Nothing wrong with this behaviour, the low  high point are the same,
hence the false output indicating failure.
  
   Actually, I think this is a bug, and I see the usefulnes in having the
   floor and bottom having the same value. I can write up a patch if
   needed.
 
  What would be an output then, array() ?

 range(2,4) gives  array(2,3,4);
 range(2,3) gives  array(2,3);
 range(2,2) gives  array(2);

Good idea, +1.

I'll prepare a patch.

Ilia

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /sapi/cli php_cli.c

2002-12-20 Thread Moriyoshi Koizumi
Andi Gutmans [EMAIL PROTECTED] wrote:

 At 01:28 PM 12/19/2002 +, Wez Furlong wrote:
 Actually, it does seem valid to me; streams based on FILE* are not
 registered in the persistent list, so does it make sense to have the
 associated resources registered as persistent resources when they will
 get cleaned up by the engine at request shutdown?
 
 If these are per-request constants then you are correct and the patch was 
 OK. I thought these were constants which survive requests.

Well, only in cli are the constants STDIN, STDOUT, and STDERR registered.
So can I commit the patch again?

Moriyoshi

 Andi
 
 
 --Wez.
 
 On Wed, 18 Dec 2002, Andi Gutmans wrote:
 
   I don't like these voodoo patches. I think if the stream is destroyed twice
   that should be solved and not the constant itself.
   Unless you have a good reason please revert your patch and talk to Wez
   about fixing this properly.
   Thanks,
  
   Andi
 
 -   ic.flags = CONST_CS | CONST_PERSISTENT;
 +   ic.flags = CONST_CS;
 


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Changelog broken?

2002-12-20 Thread Andrei Zmievski
Ilia has rewritten the old php-rcs2log script in PHP itself and it's
working wonderfully. The Changelog generation is back online.

On Mon, 11 Nov 2002, Andrei Zmievski wrote:
 On Mon, 11 Nov 2002, Steve Alberty wrote:
  Hi,
  
  the Changelog file in the php4 cvs tree is unchanged since 7 days.
  Is the script (cvs2cl ?) broken?
 
 It's actually rcs2log script with some modifications. And yes, I think
 the number of CVS accounts has finally broken this poor script's back.
 awk dies with the message argument list too long.
 
 -Andrei   http://www.gravitonic.com/
 * I do not envy the guy at [EMAIL PROTECTED] -- me *
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php



-Andrei   http://www.gravitonic.com/
* Think digital, act analog. *

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: [PHP-CVS] cvs: php4 /sapi/cli php_cli.c

2002-12-20 Thread Andi Gutmans
At 11:57 PM 12/20/2002 +0900, Moriyoshi Koizumi wrote:

Andi Gutmans [EMAIL PROTECTED] wrote:

 At 01:28 PM 12/19/2002 +, Wez Furlong wrote:
 Actually, it does seem valid to me; streams based on FILE* are not
 registered in the persistent list, so does it make sense to have the
 associated resources registered as persistent resources when they will
 get cleaned up by the engine at request shutdown?

 If these are per-request constants then you are correct and the patch was
 OK. I thought these were constants which survive requests.

Well, only in cli are the constants STDIN, STDOUT, and STDERR registered.
So can I commit the patch again?


Yep.

Andi


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] ZE2: accessing a class static variable

2002-12-20 Thread Mickael Bailly

Hello,

One line to say this is my first post here, I thought about posting in 
php-general, but ZE2 is in development, so...

I want to access a static variable of a class, but I CANNOT use directly the 
class name, so class name is in a variable.

To be clear:

?PHP

class foo {
static $conf = 'configuration variable';
}

$var = 'foo';

echo $var::$conf ;

?

this produces a parsing error...

How could I do ?

Thanks

-- 
Mickael Bailly

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] ZE2: accessing a class static variable

2002-12-20 Thread Andi Gutmans
This is a known limitation. I will try and address this probably with some 
kind of special syntax.

Andi

At 04:49 PM 12/20/2002 +0100, Mickael Bailly wrote:

Hello,

One line to say this is my first post here, I thought about posting in
php-general, but ZE2 is in development, so...

I want to access a static variable of a class, but I CANNOT use directly the
class name, so class name is in a variable.

To be clear:

?PHP

class foo {
static $conf = 'configuration variable';
}

$var = 'foo';

echo $var::$conf ;

?

this produces a parsing error...

How could I do ?

Thanks

--
Mickael Bailly

--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php



--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] CLI php.exe on WIn32

2002-12-20 Thread Frank M. Kromann
Hi,

The latest changes to the project files under WIn32, creates name
conflict, by having php.exe created from two different projects in the
same directory. I suggest that we move the cli version

from ..\Release_TS to ..\Release_TS\cli

And the same for Debug_TS and Release_inline_ts builds.

- Frank





-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] CLI php.exe on WIn32

2002-12-20 Thread Marcus Börger
At 18:27 20.12.2002, Frank M. Kromann wrote:

Hi,

The latest changes to the project files under WIn32, creates name
conflict, by having php.exe created from two different projects in the
same directory. I suggest that we move the cli version

from ..\Release_TS to ..\Release_TS\cli

And the same for Debug_TS and Release_inline_ts builds.

- Frank



Iirc we decided to put the CLI version in a subdirectory, we're not
doing by latest changes?

marcus


--
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] ZE2: accessing a class static variable

2002-12-20 Thread Markus Fischer
Hi,

while it's good to read that Andi is thinking of something,
this issue has been brought up recently. If you need a
workaround now, you can use eval() to accomplish this.

- Markus

On Fri, Dec 20, 2002 at 04:49:00PM +0100, Mickael Bailly wrote : 
 
   Hello,
 
 One line to say this is my first post here, I thought about posting in 
 php-general, but ZE2 is in development, so...
 
 I want to access a static variable of a class, but I CANNOT use directly the 
 class name, so class name is in a variable.
 
 To be clear:
 
 ?PHP
 
 class foo {
 static $conf = 'configuration variable';
 }
 
 $var = 'foo';
 
 echo $var::$conf ;
 
 ?
 
 this produces a parsing error...
 
 How could I do ?
 
 Thanks
 
 -- 
 Mickael Bailly
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] mysql 4.0.6 gamma and php 4.3.0 .... ?

2002-12-20 Thread tijn
I have a problem that I think might be caused by the version of the mysql
client that is included with the binary of php as standard. When i run the
following query:

SELECT * FROM rs_projects AS p LEFT JOIN rs_proj_members AS m USING
(proj_id) WHERE (p.create_id='3') OR (m.user_id='3' AND (m.rights  '8' =
8))

And retrieve the row's as arrays in php, then the arrays are fine when using
the $myrow[0] $myrow[1] method, but for some rows, when using the
$myrow['id'] NULL is returned.

When running the query direct from MySQL or through MySQL-Front, all results
are returned ok.

Can someone confirm that my expectation is correct, and let me know how I
can get hold of php 4.3.0 that runs with a more up-to-date client? I know
that I can achieve this by recompiling, but I am on windows and don't own
Visual C++.

Thanks
Tijn

WinXP / Apache 2.0.43 / PHP4.3.0 18 Dec build / MySQL 4.0.6 gamma

MySQL client info: 3.23.49
MySQL host info: localhost via TCP/IP MySQL server version:
4.0.6-gamma-max-nt





-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] mysql 4.0.6 gamma and php 4.3.0 .... ?

2002-12-20 Thread Derick Rethans
On Fri, 20 Dec 2002, tijn wrote:

 Can someone confirm that my expectation is correct, and let me know how I
 can get hold of php 4.3.0 that runs with a more up-to-date client? I know
 that I can achieve this by recompiling, but I am on windows and don't own
 Visual C++.

http://snaps.php.net/

Derick

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DEV] CLI php.exe on WIn32

2002-12-20 Thread Sjon
This might be an option:

build the cgi  cli as php-cgi.exe and php-cli.exe respectively,
and add a post build event that copies the php-cgi.exe
to php.exe, or something like that...

Aren't the windows dist's made by hand anyway??

Sjon.

-Original Message-
From: Frank M. Kromann [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 20, 2002 18:28 pm
To: [EMAIL PROTECTED]
Subject: [PHP-DEV] CLI php.exe on WIn32


Hi,

The latest changes to the project files under WIn32, creates name
conflict, by having php.exe created from two different projects in the
same directory. I suggest that we move the cli version

from ..\Release_TS to ..\Release_TS\cli

And the same for Debug_TS and Release_inline_ts builds.

- Frank



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Re: mysql 4.0.6 gamma and php 4.3.0 .... ?

2002-12-20 Thread tijn
I had a conversation with derick over email - here is a summary for those
struggeling with the same issue:

4.3 will not include the new mysql client compatible with mysql 4
This will be included in php 4.4 / 5
4.4/5 will include an extension which is much more compatible with mysql 4
The current CVS of php 4.4 does not yet include this new extension



Hope this helps others

tijn



-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] Re: mysql 4.0.6 gamma and php 4.3.0 .... ?

2002-12-20 Thread Thomas Seifert
what's the exact problem with the php/mysql4-interaction?
I'm using mysql-4.0.5 and php-4.2.3 in production without any problems.
Ok, I'm not using any special features of mysql4 ;-).


Regards,

Thomas

On Fri, 20 Dec 2002 21:28:44 - [EMAIL PROTECTED] (Tijn) wrote:

 I had a conversation with derick over email - here is a summary for those
 struggeling with the same issue:
 
 4.3 will not include the new mysql client compatible with mysql 4
 This will be included in php 4.4 / 5
 4.4/5 will include an extension which is much more compatible with mysql 4
 The current CVS of php 4.4 does not yet include this new extension
 
 
 
 Hope this helps others
 
 tijn
 
 

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: mysql 4.0.6 gamma and php 4.3.0 .... ?

2002-12-20 Thread Derick Rethans
On Fri, 20 Dec 2002, Thomas Seifert wrote:

 what's the exact problem with the php/mysql4-interaction?
 I'm using mysql-4.0.5 and php-4.2.3 in production without any problems.
 Ok, I'm not using any special features of mysql4 ;-).

Nothing, just that the mysql extension in the Windows build is linked 
against the bundled mysql which is of version 3.23.53, and not to an 
external library with a version 4 library.

Derick

 On Fri, 20 Dec 2002 21:28:44 - [EMAIL PROTECTED] (Tijn) wrote:
 
  I had a conversation with derick over email - here is a summary for those
  struggeling with the same issue:
  
  4.3 will not include the new mysql client compatible with mysql 4
  This will be included in php 4.4 / 5
  4.4/5 will include an extension which is much more compatible with mysql 4
  The current CVS of php 4.4 does not yet include this new extension
  
  
  
  Hope this helps others
  
  tijn
  
  
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php
 

-- 

-
 Derick Rethans http://derickrethans.nl/ 
 PHP Magazine - PHP Magazine for Professionals   http://php-mag.net/
-


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DEV] RC4: ground rules

2002-12-20 Thread Andrei Zmievski
Everyone,

I have just released 4.3.0RC4. Despite the quote in my signature, I am
determined to keep this one the very last final RC of the interminable
4.3.0 development cycle. Towards that end, I will closely monitor the
CVS commits and revert any that do not satisfactorily explain what
critical or showstopper bug they are fixing. I am aware that
PHP_AUTH_USER issue raises certain concerns, but no one apparently could
make a patch. If, however, one appears very soon, I may consider it a
special one and apply it for 4.3.0.

-Andrei   http://www.gravitonic.com/

The time from now until the completion
 of the project tends to become constant. -- Douglas Hartree

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] Re: #21060 [Opn-Bgs]: range() gives warning and returns false when low == high

2002-12-20 Thread Chandrashekhar Bhosle

On Fri, 20 Dec 2002 09:44:49 -0500
Ilia A. [EMAIL PROTECTED] wrote:

   What would be an output then, array() ?
 
  range(2,4) gives  array(2,3,4);
  range(2,3) gives  array(2,3);
  range(2,2) gives  array(2);
 
 Good idea, +1.
 
 I'll prepare a patch.

http://freedomink.org/code/php/patches/array.c.patch

My patch submitted with the bug report does exactly that.
(Returns array(low) if high == low.)

I would appreciate if you had a look at it.

- cnb

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] RC4: ground rules

2002-12-20 Thread Frank M. Kromann
Hi Andrei,

Should I commit a small fix to the Windows projects to avoid having the
CGI and CLI produce php.exe to the same directory ?

- Frank

 Everyone,
 
 I have just released 4.3.0RC4. Despite the quote in my signature, I am
 determined to keep this one the very last final RC of the interminable
 4.3.0 development cycle. Towards that end, I will closely monitor the
 CVS commits and revert any that do not satisfactorily explain what
 critical or showstopper bug they are fixing. I am aware that
 PHP_AUTH_USER issue raises certain concerns, but no one apparently
could
 make a patch. If, however, one appears very soon, I may consider it a
 special one and apply it for 4.3.0.
 
 -Andrei  
http://www.gravitonic.com/
 
 The time from now until the completion
  of the project tends to become constant. -- Douglas Hartree
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 




-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DEV] RC4: ground rules

2002-12-20 Thread Philip Olson

Attatched is a patch that essentially goes back
to 4.2.3 behavior except the external auth will not
be available with PHP in safe mode.  REMOTE_USER
exists regardless.  

It seems some people also wanted an ini option, I don't 
know how to do that! :)

References for this patch:
 http://bugs.php.net/20441
 http://cvs.php.net/diff.php/php4/sapi/apache/mod_php4.c?r1=1.132r2=1.133

On a related note, I'm curious why PHP_AUTH_TYPE does
not exist, only the variable AUTH_TYPE does (for me).  
PHP_AUTH_TYPE has been documented forever, not sure if
it used to exist but various parts of PHP4 source make
it seem like it should.

Regards,
Philip Olson

p.s. Thanks to Wez and Steph for teaching me not to fear 
the source.


On Fri, 20 Dec 2002, Andrei Zmievski wrote:

 Everyone,
 
 I have just released 4.3.0RC4. Despite the quote in my signature, I am
 determined to keep this one the very last final RC of the interminable
 4.3.0 development cycle. Towards that end, I will closely monitor the
 CVS commits and revert any that do not satisfactorily explain what
 critical or showstopper bug they are fixing. I am aware that
 PHP_AUTH_USER issue raises certain concerns, but no one apparently could
 make a patch. If, however, one appears very soon, I may consider it a
 special one and apply it for 4.3.0.
 
 -Andrei   http://www.gravitonic.com/
 
 The time from now until the completion
  of the project tends to become constant. -- Douglas Hartree
 
 -- 
 PHP Development Mailing List http://www.php.net/
 To unsubscribe, visit: http://www.php.net/unsub.php
 



Index: mod_php4.c
===
RCS file: /repository/php4/sapi/apache/mod_php4.c,v
retrieving revision 1.148
diff -u -r1.148 mod_php4.c
--- mod_php4.c  1 Dec 2002 03:28:21 -   1.148
+++ mod_php4.c  21 Dec 2002 05:18:12 -
@@ -448,7 +448,7 @@
authorization = table_get(r-headers_in, Authorization);
}
if (authorization
-!auth_type(r)
+(!PG(safe_mode) || (PG(safe_mode)  !auth_type(r)))
 !strcasecmp(getword(r-pool, authorization, ' '), Basic)) {
tmp = uudecode(r-pool, authorization);
SG(request_info).auth_user = getword_nulls_nc(r-pool, tmp, ':');

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DEV] RC4: ground rules

2002-12-20 Thread Moriyoshi Koizumi
Ohh, it seems we have been working on the same patch simultaneously :)

Attached is my version of fix for bug #20441, which adopts a new ini entry 
php_auth_exposure so that administrators can selectively expose auth 
information to the clients regardless of safe_mode settings.

Possible values are:

- php_auth_exposure=user
  Only PHP_AUTH_USER is exposed.

- php_auth_exposure=pw
  Only PHP_AUTH_PW is exposed

- php_auth_exposure=user,pw
  Both PHP_AUTH_USER and PHP_AUTH_PW are exposeed

Hope this helps.

Moriyoshi

Philip Olson [EMAIL PROTECTED] wrote:

 
 Attatched is a patch that essentially goes back
 to 4.2.3 behavior except the external auth will not
 be available with PHP in safe mode.  REMOTE_USER
 exists regardless.  
 
 It seems some people also wanted an ini option, I don't 
 know how to do that! :)
 
 References for this patch:
  http://bugs.php.net/20441
  http://cvs.php.net/diff.php/php4/sapi/apache/mod_php4.c?r1=1.132r2=1.133
 
 On a related note, I'm curious why PHP_AUTH_TYPE does
 not exist, only the variable AUTH_TYPE does (for me).  
 PHP_AUTH_TYPE has been documented forever, not sure if
 it used to exist but various parts of PHP4 source make
 it seem like it should.
 
 Regards,
 Philip Olson
 
 p.s. Thanks to Wez and Steph for teaching me not to fear 
 the source.
 
 
 On Fri, 20 Dec 2002, Andrei Zmievski wrote:
 
  Everyone,
  
  I have just released 4.3.0RC4. Despite the quote in my signature, I am
  determined to keep this one the very last final RC of the interminable
  4.3.0 development cycle. Towards that end, I will closely monitor the
  CVS commits and revert any that do not satisfactorily explain what
  critical or showstopper bug they are fixing. I am aware that
  PHP_AUTH_USER issue raises certain concerns, but no one apparently could
  make a patch. If, however, one appears very soon, I may consider it a
  special one and apply it for 4.3.0.
  
  -Andrei   http://www.gravitonic.com/
  
  The time from now until the completion
   of the project tends to become constant. -- Douglas Hartree
  
  -- 
  PHP Development Mailing List http://www.php.net/
  To unsubscribe, visit: http://www.php.net/unsub.php
  
 
 

Index: main/main.c
===
RCS file: /repository/php4/main/main.c,v
retrieving revision 1.520
diff -u -r1.520 main.c
--- main/main.c 16 Dec 2002 15:43:52 -  1.520
+++ main/main.c 21 Dec 2002 06:17:30 -
@@ -112,6 +112,9 @@
 
 static void php_build_argv(char *s, zval *track_vars_array TSRMLS_DC);
 
+static PHP_INI_MH(OnUpdate_php_auth_exposure);
+#define PHP_EXPOSE_AUTH_USER 0x0001
+#define PHP_EXPOSE_AUTH_PW   0x0002 
 
 static char *short_track_vars_names[] = {
_POST,
@@ -275,6 +278,7 @@
STD_PHP_INI_ENTRY(output_handler, NULL,   
PHP_INI_PERDIR|PHP_INI_SYSTEM,  OnUpdateString, output_handler, 
php_core_globals,   core_globals)
STD_PHP_INI_BOOLEAN(register_argc_argv,   1,
PHP_INI_PERDIR|PHP_INI_SYSTEM,  OnUpdateBool,   register_argc_argv, 
php_core_globals,   core_globals)
STD_PHP_INI_BOOLEAN(register_globals, 0,
PHP_INI_PERDIR|PHP_INI_SYSTEM,  OnUpdateBool,   register_globals,   
php_core_globals,   core_globals)
+   STD_PHP_INI_ENTRY(php_auth_exposure,  none, 
+PHP_INI_SYSTEM, OnUpdate_php_auth_exposure, php_auth_exposure,  
+php_core_globals,   core_globals)
 #if PHP_SAFE_MODE
STD_PHP_INI_BOOLEAN(safe_mode,1,
PHP_INI_SYSTEM, OnUpdateBool,   safe_mode, 
 php_core_globals,   core_globals)
 #else
@@ -1191,6 +1195,7 @@
SG(request_info).argv=(char **)NULL;
PG(connection_status) = PHP_CONNECTION_NORMAL;
PG(during_request_startup) = 0;
+   PG(php_auth_exposure) = 0;
 
CG(zend_lineno) = 0;
 
@@ -1378,10 +1383,12 @@
}
 
/* PHP Authentication support */
-   if (SG(request_info).auth_user) {
+   if ((PG(php_auth_exposure)  PHP_EXPOSE_AUTH_USER) 
+   SG(request_info).auth_user) {
php_register_variable(PHP_AUTH_USER, SG(request_info).auth_user, 
array_ptr TSRMLS_CC);
}
-   if (SG(request_info).auth_password) {
+   if ((PG(php_auth_exposure)  PHP_EXPOSE_AUTH_PW) 
+   SG(request_info).auth_password) {
php_register_variable(PHP_AUTH_PW, SG(request_info).auth_password, 
array_ptr TSRMLS_CC);
}
 }
@@ -1820,6 +1827,66 @@
 }
 /* }}} */
 #endif
+
+/* {{{ OnUpdate_php_auth_exposure */
+static PHP_INI_MH(OnUpdate_php_auth_exposure)
+{
+   char *comp, *p1;
+   int eos;
+   long val = 0;
+   int sp_cnt;
+
+   comp = NULL;
+
+   p1 = new_value;
+   eos = 0;
+
+   do {
+   if (*p1 == '\0') {
+   eos = 1;
+