[PHP-BUG] Bug #52163 [NEW]: fails due to parameter that can't be set

2010-06-23 Thread v-ryanbi at microsoft dot com
From: 
Operating system: Windows 7
PHP version:  5.2.14RC1
Package:  SPL related
Bug Type: Bug
Bug description:fails due to parameter that can't be set

Description:

When calling SplFileObject::ffgetss() in 5.2.x (including the 5.2.14 RC1),
a 

warning is thrown and the cursor is *not* advanced. Since this would
typically be 

used in a while(!$fileObj->eof()) loop, it can result in an infinite loop.



The complaint thrown in the warning is that the Length parameter must be
greater 

than 0. While Length is a valid parameter in the global fgetss function,
the SPL 

version of this function only accepts one parameter, and that is for
accepted 

tags.

Test script:
---


 Welcome! Today is the  of .



Text outside of the HTML block.

EOD;



$filePath="filename.php";

file_put_contents($filePath, $str);





$fileObject = new SplFileObject($filePath);

while (!$fileObject->eof()) {

echo $fileObject->fgetss('body');

}

?>

Expected result:

 Welcome! Today is the  of .



Text outside of the HTML block.

Actual result:
--
Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



... and on to infinity.

-- 
Edit bug report at http://bugs.php.net/bug.php?id=52163&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=52163&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=52163&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=52163&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=52163&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52163&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=52163&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=52163&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=52163&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=52163&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=52163&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=52163&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=52163&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=52163&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=52163&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=52163&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=52163&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=52163&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=52163&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=52163&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=52163&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=52163&r=mysqlcfg



Bug #52163 [Opn]: SplFileObject::fgetss() fails due to parameter that can't be set

2010-06-23 Thread v-ryanbi at microsoft dot com
Edit report at http://bugs.php.net/bug.php?id=52163&edit=1

 ID:   52163
 User updated by:  v-ryanbi at microsoft dot com
 Reported by:      v-ryanbi at microsoft dot com
-Summary:  fails due to parameter that can't be set
+Summary:  SplFileObject::fgetss() fails due to parameter that
   can't be set
 Status:   Open
 Type: Bug
 Package:  SPL related
 Operating System: Windows 7
 PHP Version:  5.2.14RC1

 New Comment:

Argh. typo. In the description it should be SplFileObject::fgetss().


Previous Comments:

[2010-06-23 21:16:20] v-ryanbi at microsoft dot com

Description:

When calling SplFileObject::ffgetss() in 5.2.x (including the 5.2.14
RC1), a 

warning is thrown and the cursor is *not* advanced. Since this would
typically be 

used in a while(!$fileObj->eof()) loop, it can result in an infinite
loop.



The complaint thrown in the warning is that the Length parameter must be
greater 

than 0. While Length is a valid parameter in the global fgetss function,
the SPL 

version of this function only accepts one parameter, and that is for
accepted 

tags.

Test script:
---


 Welcome! Today is the  of .



Text outside of the HTML block.

EOD;



$filePath="filename.php";

file_put_contents($filePath, $str);





$fileObject = new SplFileObject($filePath);

while (!$fileObject->eof()) {

echo $fileObject->fgetss('body');

}

?>

Expected result:

 Welcome! Today is the  of .



Text outside of the HTML block.

Actual result:
--
Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



Warning: fgetss(): Length parameter must be greater than 0 in 

C:\fgetssBug\fgetss_basic.php on line 13



... and on to infinity.






-- 
Edit this bug report at http://bugs.php.net/bug.php?id=52163&edit=1


#50690 [Com]: putenv() does not assign values to env. vars when the value is one character

2010-01-22 Thread v-ryanbi at microsoft dot com
 ID:   50690
 Comment by:   v-ryanbi at microsoft dot com
 Reported By:  php at keithtyler dot com
 Status:   No Feedback
 Bug Type: PHP options/info functions
 Operating System: Windows XP
 PHP Version:  5.3.1
 New Comment:

Bug still exhibited.

SVN revision 293853 Clean (checked out 2010-01-22 10:15 PST)
Compiled on Windows 2008 R2 / VC9 (VS 2010 Express)


Previous Comments:


[2010-01-16 01:00:00] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".



[2010-01-08 07:02:05] j...@php.net

Please try using this snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/

It's either fixed or win32 only issue since I can't reproduce this
under linux using latest SVN checkout.



[2010-01-08 01:35:52] php at keithtyler dot com

Description:

In PHP 5.3.1, a putenv() call with a one character value does not
assign the value to the variable -- however it does create the
variable.

It doesn't matter what type of character it is (alpha, numeric, or
other).

A workaround is to add a space character before or after the value,
e.g.:

putenv("bar= x");
putenv("bar=x ");

(...as long as this space does not cause problems for the consumers of
the variable as it will be part of the string value.)

Reproduce code:
---


Expected result:

We would expect the output to be:

string(2) "ab"
string(1) "c"
bool(false)

which it does under PHP 5.3.0.

Actual result:
--
string(2) "ab"
string(0) ""
bool(false)





-- 
Edit this bug report at http://bugs.php.net/?id=50690&edit=1



#50836 [NEW]: run_tests.php alerts syntax errors while testing session

2010-01-25 Thread v-ryanbi at microsoft dot com
From: v-ryanbi at microsoft dot com
Operating system: Windows Server 2008 R2
PHP version:  5.3SVN-2010-01-25 (SVN)
PHP Bug Type: Session related
Bug description:  run_tests.php alerts syntax errors while testing session

Description:

During execution of 'run-tests.php' from the cmd shell, at several points
an alert dialog is created, bypassing stdout and stderr. The contents of
the alert is:

---
PHP Error
---
parse error, expecting `TC_DOLLAR_CURLY' or `TC_QUOTED_STRING' or `'\"''
in Unknown on line 39

---
OK   
---

It appears twice immediately after each of the following outputs, none of
which have 39 lines, so I'm suspecting it's failing on eval'd code at some
point:

TEST 3029/8140 ext\session\tests\020.phpt
TEST 3047/8140 ext\session\tests\bug41600.phpt
TEST 3048/8140 ext\session\tests\bug42596.phpt

No syntax errors are present in the --FILE section of the tests or in the
files generated.

Reproduce code:
---
C:\>SET PHP_TEST_EXECUTABLE=C:\path\to\php\source\Release\php.exe
C:\>cd \path\to\php\source
C:\path\to\php\source>Release\php.exe run-tests.php

Expected result:

No errors would be nice :)

Actual result:
--
See Description

-- 
Edit bug report at http://bugs.php.net/?id=50836&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=50836&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=50836&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=50836&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=50836&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=50836&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=50836&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=50836&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=50836&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=50836&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=50836&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=50836&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=50836&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=50836&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=50836&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=50836&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=50836&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=50836&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=50836&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=50836&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=50836&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=50836&r=mysqlcfg



#50836 [Asn->Opn]: run_tests.php alerts syntax errors while testing session

2010-01-25 Thread v-ryanbi at microsoft dot com
 ID:   50836
 User updated by:  v-ryanbi at microsoft dot com
 Reported By:  v-ryanbi at microsoft dot com
-Status:   Assigned
+Status:   Open
 Bug Type: Session related
 Operating System: Windows Server 2008 R2
 PHP Version:  5.3SVN-2010-01-25 (SVN)
 Assigned To:  pajoye
 New Comment:

Upon further inspection, I found the test log files potentially
relevant. All three tests actual output is the same. 

ext\session\tests\020.log
 EXPECTED OUTPUT

 ACTUAL OUTPUT
'amp' is not recognized as an internal or external command,
operable program or batch file.
 FAILED

ext\session\tests\bug41600.log
 EXPECTED OUTPUT

 ACTUAL OUTPUT
'amp' is not recognized as an internal or external command,
operable program or batch file.
 FAILED

ext\session\tests\bug42596.log
 EXPECTED OUTPUT
hello world
string(6) "100777"
 ACTUAL OUTPUT
'amp' is not recognized as an internal or external command,
operable program or batch file.
 FAILED


Previous Comments:


[2010-01-25 19:37:23] paj...@php.net

That's due to the (somehow broken) --INI-- section:

arg_separator.output="&"

If you replace this line with:

arg_separator.output=&

it should work well.

I don't have a work around for run-tests.php right now, patch welcome
if you find a portable solution (has to work on all platforms).

--------------------

[2010-01-25 18:46:38] v-ryanbi at microsoft dot com

Description:

During execution of 'run-tests.php' from the cmd shell, at several
points an alert dialog is created, bypassing stdout and stderr. The
contents of the alert is:

---
PHP Error
---
parse error, expecting `TC_DOLLAR_CURLY' or `TC_QUOTED_STRING' or
`'\"'' in Unknown on line 39

---
OK   
---

It appears twice immediately after each of the following outputs, none
of which have 39 lines, so I'm suspecting it's failing on eval'd code at
some point:

TEST 3029/8140 ext\session\tests\020.phpt
TEST 3047/8140 ext\session\tests\bug41600.phpt
TEST 3048/8140 ext\session\tests\bug42596.phpt

No syntax errors are present in the --FILE section of the tests or in
the files generated.

Reproduce code:
---
C:\>SET PHP_TEST_EXECUTABLE=C:\path\to\php\source\Release\php.exe
C:\>cd \path\to\php\source
C:\path\to\php\source>Release\php.exe run-tests.php

Expected result:

No errors would be nice :)

Actual result:
--
See Description





-- 
Edit this bug report at http://bugs.php.net/?id=50836&edit=1



Bug #40163 [Com]: UNC Path not working

2010-12-03 Thread v-ryanbi at microsoft dot com
Edit report at http://bugs.php.net/bug.php?id=40163&edit=1

 ID: 40163
 Comment by:     v-ryanbi at microsoft dot com
 Reported by:coyle at washpenn dot com
 Summary:UNC Path not working
 Status: Feedback
 Type:   Bug
 Package:Directory function related
 Operating System:   Windows 2003
 PHP Version:5.3
 Assigned To:pajoye
 Block user comment: N
 Private report: N

 New Comment:

I cannot replicate this bug. Using the following script under IIS 

(with and without fastcgi.impersonate), under Apache2.2, and via 

CLI, all with recommended INI settings for both 5.3.4RC2 and 

5.2.15RC2, I get expected output:



'test_folder',

'missing'=>'not_here',

'file'=>'foo.txt',

);

foreach( $targets as $name => $target ) {

echo $name."\n";

$path = $share . DIRECTORY_SEPARATOR . $target;

echo '  path:   '; var_dump( $path );

echo '  is_dir: '; var_dump( is_dir( $path ) );

}

echo '---TEST-TWO---'."\n";

$bartxt = fopen( ( $share . DIRECTORY_SEPARATOR . 'bar.txt' ), "w" ) 

  or false;

if( !$bartxt ) {

echo 'failed to open stream';

} else {

fwrite( $bartxt, 'FUBAR '.time() );

fclose( $bartxt );

echo 'wrote file.';

}?>



Example result (IIS with impersonation):



---TEST-ONE---

exists

  path:   string(43) "\\win7-share-af04\share\test_folder"

  is_dir: bool(true)

missing

  path:   string(40) "\\win7-share-af04\share\not_here"

  is_dir: bool(false)

file

  path:   string(39) "\\win7-share-af04\share\foo.txt"

  is_dir: bool(false)

---TEST-TWO---

wrote file.



The file is created properly and is_dir reports accurately in 

all scenarios, except that which I don't have permission to see 

the share or the share is inaccessible. Have you tried using 

procmon to see the request for the file and the filesystem's 

response?


Previous Comments:

[2010-11-26 19:37:30] hjan at libero dot it

Here the SO as showed by phpinfo : 

Windows NT W-WEB01 6.1 build 7600 (Unknow Windows version Standard
Edition) i586 

it's a Windows 2008 R2 Standard

IIS application pool runs with a domain administrator account. Share
runs on another server, W2003 STD, everyone users has full rights on
both share permission and physical folder permission.

With this test page named testdir.php:



I obtain "can't open" on the web page and this message on the event
log:

The description for Event ID 2 from source PHP-5.3.4RC1 cannot be found.
Either the component that raises this event is not installed on your
local computer or the installation is corrupted. You can install or
repair the component on the local computer.



If the event originated on another computer, the display information had
to be saved with the event.



The following information was included with the event: 



php[3852]

PHP Warning:  fopen(\\ett2\tempdb\somefile.txt) [function.fopen]: failed to open stream:
Invalid argument in [sitephysicalpath]\testdir.php on line 5



Let me know if you need more information or if i could help with more
test.

Regards,

Gianluca


[2010-11-26 18:16:15] paj...@php.net

Not sure what C:\ETT\SITI\moodle\lib\setuplib.php is, but mkdir & co
work just fine here (various windows). Please provide a small script
with an explanation of your configuration (OS version where php runs, OS
where the UNC target is).


[2010-11-26 16:33:54] hjan at libero dot it

still no luck with 5.3.4RC1

php[4452]

PHP Warning:  mkdir() [function.mkdir]:
Invalid argument in C:\ETT\SITI\moodle\lib\setuplib.php on line 167


[2010-11-26 12:33:34] paj...@php.net

Please try using 5.3.4RC1.


[2010-11-26 08:53:06] hjan at libero dot it

PHP 5.3.3, windows 2008 R2, IIS 7.5.

This simple page:





return me PHP Warning: fopen(\\server\share\somefile.txt)
[function.fopen]: failed to open stream: Invalid argument in
C:\xxx\xxx\moodle\testdir.php on line 4 



If I comment the write function I obtain :

directory\\server\share\ does not exists




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

http://bugs.php.net/bug.php?id=40163


-- 
Edit this bug report at http://bugs.php.net/bug.php?id=40163&edit=1