#40359 [Opn->Bgs]: DOMDocument's saveHTML() ignores formatOutput property

2007-02-04 Thread chregu
 ID:   40359
 Updated by:   [EMAIL PROTECTED]
 Reported By:  gmtfn at yahoo dot com
-Status:   Open
+Status:   Bogus
 Bug Type: DOM XML related
 Operating System: Linux and Windows
 PHP Version:  5.2.0
 New Comment:

use saveXML instead of saveHTML and you get, what you expect (maybe
also try loadXML, instead of loadXML, depending on what's your input)

Besides that, it's not a PHP, but a libxml2 issue, since PHP only uses
the functions from there (and I assume, they do the correct thing
regarding whitespaces, html and the specs)

load/saveHTML should only be used, if you want to use HTML 4.0, for
xhtml, you're supposed to use the load/saveXML stuff.


Previous Comments:


[2007-02-05 01:14:42] gmtfn at yahoo dot com

Your system changed my input. Before you test it, put everything
between opening and closing UL tags on one line.



[2007-02-05 01:09:35] gmtfn at yahoo dot com

Description:

The saveHTML() method of DOMDocument reformats input HTML contents
(from an HTML file or a string in a PHP file) despite that formatOutput
property is set to false.

Setting preserveWhiteSpace to true or false before or after loading the
HTML input doesn't seem to make a difference.

This may not seem important, but it breaks a third party menu software
I am using on Mozilla based browsers.

I've tried this with PHP 5.2 on Linux and PHP 5.1.x on Windows, with
the same results.

Reproduce code:
---


http://site.com";>sitehttp://site.com";>another sitehttp://site.com";>third site


EOF;

$doc = new DOMDocument();
$doc->loadHTML($myhtml);
$doc->formatOutput = false;
echo $doc->saveHTML();
?>

Expected result:

I expected to see NO changed at all done to the input HTML. That's what
the "formatOutput = false" is for, isn't it?

By the way, setting this property to true doesn't seem to produce
anything different from what happens the property is set to false.

Actual result:
--
It reformats some fragments but leaves others in tact. Less important
(for me) changes are: body and html opening and closing tags are put on
2 lines even though in the input they occupy 4 lines. But the important
changes are:
the anchor tag is moved on a new line if it is a part of a  that
contains an  as well. See the code: the second  element is move
to a new line, away from its parent .





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



#40360 [Opn->Csd]: current locale affects how json_encode encodes floats

2007-02-04 Thread ftl_ at freemail dot hu
 ID:   40360
 User updated by:  ftl_ at freemail dot hu
 Reported By:  ftl_ at freemail dot hu
-Status:   Open
+Status:   Closed
 Bug Type: Variables related
 Operating System: Gentoo Linux
 PHP Version:  5.2.0
 New Comment:

fixed in PHP 5.2.1RC5-dev (cli) (built: Feb  5 2007 00:22:58)
(sorry for this thoughtless bugreport.)


Previous Comments:


[2007-02-05 02:09:28] ftl_ at freemail dot hu

Description:

json_encode is using the decimal separator of the current locale
instead of using "."
(similar to http://bugs.php.net/bug.php?id=40235)

Reproduce code:
---


Expected result:

string(3) "1.2"
string(3) "1.2"

Actual result:
--
string(3) "1.2"
string(3) "1,2"





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


#40360 [NEW]: current locale affects how json_encode encodes floats

2007-02-04 Thread ftl_ at freemail dot hu
From: ftl_ at freemail dot hu
Operating system: Gentoo Linux
PHP version:  5.2.0
PHP Bug Type: Variables related
Bug description:  current locale affects how json_encode encodes floats

Description:

json_encode is using the decimal separator of the current locale instead
of using "."
(similar to http://bugs.php.net/bug.php?id=40235)

Reproduce code:
---


Expected result:

string(3) "1.2"
string(3) "1.2"

Actual result:
--
string(3) "1.2"
string(3) "1,2"

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


#40359 [Opn]: DOMDocument's saveHTML() ignores formatOutput property

2007-02-04 Thread gmtfn at yahoo dot com
 ID:   40359
 User updated by:  gmtfn at yahoo dot com
 Reported By:  gmtfn at yahoo dot com
 Status:   Open
 Bug Type: DOM XML related
 Operating System: Linux and Windows
 PHP Version:  5.2.0
 New Comment:

Your system changed my input. Before you test it, put everything
between opening and closing UL tags on one line.


Previous Comments:


[2007-02-05 01:09:35] gmtfn at yahoo dot com

Description:

The saveHTML() method of DOMDocument reformats input HTML contents
(from an HTML file or a string in a PHP file) despite that formatOutput
property is set to false.

Setting preserveWhiteSpace to true or false before or after loading the
HTML input doesn't seem to make a difference.

This may not seem important, but it breaks a third party menu software
I am using on Mozilla based browsers.

I've tried this with PHP 5.2 on Linux and PHP 5.1.x on Windows, with
the same results.

Reproduce code:
---


http://site.com";>sitehttp://site.com";>another sitehttp://site.com";>third site


EOF;

$doc = new DOMDocument();
$doc->loadHTML($myhtml);
$doc->formatOutput = false;
echo $doc->saveHTML();
?>

Expected result:

I expected to see NO changed at all done to the input HTML. That's what
the "formatOutput = false" is for, isn't it?

By the way, setting this property to true doesn't seem to produce
anything different from what happens the property is set to false.

Actual result:
--
It reformats some fragments but leaves others in tact. Less important
(for me) changes are: body and html opening and closing tags are put on
2 lines even though in the input they occupy 4 lines. But the important
changes are:
the anchor tag is moved on a new line if it is a part of a  that
contains an  as well. See the code: the second  element is move
to a new line, away from its parent .





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


#40359 [NEW]: DOMDocument's saveHTML() ignores formatOutput property

2007-02-04 Thread gmtfn at yahoo dot com
From: gmtfn at yahoo dot com
Operating system: Linux and Windows
PHP version:  5.2.0
PHP Bug Type: DOM XML related
Bug description:  DOMDocument's saveHTML() ignores formatOutput property

Description:

The saveHTML() method of DOMDocument reformats input HTML contents (from
an HTML file or a string in a PHP file) despite that formatOutput property
is set to false.

Setting preserveWhiteSpace to true or false before or after loading the
HTML input doesn't seem to make a difference.

This may not seem important, but it breaks a third party menu software I
am using on Mozilla based browsers.

I've tried this with PHP 5.2 on Linux and PHP 5.1.x on Windows, with the
same results.

Reproduce code:
---


http://site.com";>sitehttp://site.com";>another sitehttp://site.com";>third site


EOF;

$doc = new DOMDocument();
$doc->loadHTML($myhtml);
$doc->formatOutput = false;
echo $doc->saveHTML();
?>

Expected result:

I expected to see NO changed at all done to the input HTML. That's what
the "formatOutput = false" is for, isn't it?

By the way, setting this property to true doesn't seem to produce anything
different from what happens the property is set to false.

Actual result:
--
It reformats some fragments but leaves others in tact. Less important (for
me) changes are: body and html opening and closing tags are put on 2 lines
even though in the input they occupy 4 lines. But the important changes
are:
the anchor tag is moved on a new line if it is a part of a  that
contains an  as well. See the code: the second  element is move to
a new line, away from its parent .

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


#40358 [NEW]: === Total 1 memory leaks detected === in zend_execute.c(402)

2007-02-04 Thread poni1111 at yahoo dot com
From: poni at yahoo dot com
Operating system: FreeBSD 6.0
PHP version:  5.2.0
PHP Bug Type: Performance problem
Bug description:  === Total 1 memory leaks detected === in zend_execute.c(402)

Description:

Here is what I see in my error.log: 
=== Total 1 memory leaks detected ===
[Sun Feb  4 23:11:08 2007]  Script:  '/path/to/folder/index.php'
/usr/ports/lang/php5/work/php-5.2.0/Zend/zend_execute.c(402) :  Freeing
0x083729D8 (16 bytes), script=/path/to/folder/index.php

Reproduce code:
---
In index.php I have: 

require_once('DB.php');
$db =& DB::connect( "mysql://username:[EMAIL PROTECTED]/server_attempts"
);
if (DB::isError($db)) {
echo "RE";
exit();
}
$db->setFetchMode(DB_FETCHMODE_ASSOC);

$res=$db->query("INSERT INTO `table_name` (`date`, `ip`, `reverse-dns`,
`user-agent`) VALUES (NOW(),?,?,?)", array($_SERVER['REMOTE_ADDR'],
isset($_SERVER['REMOTE_HOST'])?$_SERVER['REMOTE_HOST']:"",
$_SERVER['HTTP_USER_AGENT']));

$db->disconnect();

DB/Pear versions:
DB   1.7.8   stable
PEAR 1.5.0   stable



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


#39213 [Asn->Csd]: NULL == '' in mssql extention

2007-02-04 Thread fmk
 ID:   39213
 Updated by:   [EMAIL PROTECTED]
 Reported By:  frediano dot ziglio at vodafone dot com
-Status:   Assigned
+Status:   Closed
 Bug Type: MSSQL related
 Operating System: Linux
 PHP Version:  5.1.6
 Assigned To:  fmk
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Microsofts libraries will return a length of 1 for the empty string.
WHen the MSSQL extension is compiled with the FreeTDS library the
returned values are correct for both empty string and null values.


Previous Comments:


[2007-02-01 15:08:07] frode at coretrek dot com

We're running into the same issue. Is the patch that was provided by
the bug reporter planned for inclusion in a future release?



[2006-10-20 19:13:54] frediano dot ziglio at vodafone dot com

Mmm... perhaps a less invasive change is to add 

if (data == 0) {
   ZVAL_NULL(result);
   return;
}

after 

char *data = charcol(offset);

line on the same function.



[2006-10-20 19:08:15] frediano dot ziglio at vodafone dot com

Here you are a simplified version. It require a db but it create the
only table it needs and delete it.

Expected result:
  got --

,,) or die("opps");

mssql_query("CREATE TABLE #tmp(c VARCHAR(10) NULL)", $conn) or
die("error querying");

mssql_query("INSERT INTO #tmp VALUES('')", $conn) or die("error
querying");

$res = mssql_query("SELECT * FROM #tmp", $conn) or die("query");
$row = mssql_fetch_assoc($res);

$s = is_null($row['c']) ? 'NULL' : $row['c'];
echo "got -$s-\n";
?>

In
http://cvs.php.net/viewvc.cgi/php-src/ext/mssql/php_mssql.c?view=markup
you have 

if (dbdatlen(mssql_ptr->link,offset) == 0) {

however in order to fix the problem should be

if (dbdatlen(mssql_ptr->link,offset) == 0 &&
dbdata(mssql_ptr->link,offset) == NULL) {

note that under Windows Microsoft dblib use only older wire protocol
version which do not support empty string so it returns them as a
single space.



[2006-10-20 15:25:38] [EMAIL PROTECTED]

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.





[2006-10-20 15:16:45] frediano dot ziglio at vodafone dot com

Description:

when you get data you assume NULL if dbdatlen == 0 however is possible
that data is just an empty string (''), in this case you should check
that dbdatlen == 0 and dbdata == NULL.

Reproduce code:
---
I use this test script (pwd.inc define just variable to connect)

 $s\n";
if ($s != $expected)
{
echo "error!\n";
$result = 1;
}
}

test("SELECT top 1 * FROM #MyTable WHERE n = 1 -- ''", "(Empty
String)");

test("SELECT top 1 * FROM #MyTable WHERE n = 2 -- NULL", "(NULL)");

test("SELECT top 1 * FROM #MyTable WHERE n = 3 -- ' '", "' '");

test("SELECT top 1 * FROM #MyTable WHERE n = 4 -- 'a'", "'a'");

exit($result);
?>


Expected result:

SELECT top 1 * FROM #MyTable WHERE n = 1 -- '' -> (Empty String)
SELECT top 1 * FROM #MyTable WHERE n = 2 -- NULL -> (NULL)
SELECT top 1 * FROM #MyTable WHERE n = 3 -- ' ' -> ' '
SELECT top 1 * FROM #MyTable WHERE n = 4 -- 'a' -> 'a'


Actual result:
--
SELECT top 1 * FROM #MyTable WHERE n = 1 -- '' -> (NULL)
error!
SELECT top 1 * FROM #MyTable WHERE n = 2 -- NULL -> (NULL)
SELECT top 1 * FROM #MyTable WHERE n = 3 -- ' ' -> ' '
SELECT top 1 * FROM #MyTable WHERE n = 4 -- 'a' -> 'a'






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


#40355 [NEW]: the dcom interface doesn't support the utf8 encoding

2007-02-04 Thread info at paolotozzo dot it
From: info at paolotozzo dot it
Operating system: WINDOWS
PHP version:  5.2.0
PHP Bug Type: COM related
Bug description:  the dcom interface doesn't support the utf8 encoding

Description:

I try to test this bug with the MS Word application, with MS Excel and
with Adobe Indesign application, but I suppose that also with other
applications the result is the same.
If I insert (with COM interface) a text with non standard encoding (like
russian language , greek language etc.), I get always strange output. I
try to change all the settings in php.ini, I try to use the mbstring and
the iconv functions, but the result is the same:
1) I get the '?' symbols
2) I get the strange output

The file .php that I use for test is saved correctly in utf-8 format
I.E. I put a greek text in a variable..if I write this variable in a text
file, it work well, but If I use this var for print an output with a com
interface, it doesn't work.
I try this with all the last php versions.

Reproduce code:
---
Version}"; 

// set the visibility of the application to 0 (false) 
// to open the application in the forefront, use 1 (true)
$word->Visible = 1; 

// create a new document in Word
$word->Documents->Add(); 

// add text to the new document


//in the next line I assign at $text var a greek text string
$text="ÅëëçíéêÜ";

//i try to use the mb, with many combinations of encoding
//but the result is the same if I comment this line
$text=mb_convert_encoding($text, '', "UTF-8");


//I try to write the var in a text file, and it works well
$c=fopen("test.txt","w"); 
fputs($c,($text));


$word->Selection->TypeText($text);

//save the document in the Windows temp directory


// print another message to the screen
echo "Check for the file..."; 
?> 



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


#40353 [Bgs]: The format of strpos

2007-02-04 Thread des at envious dot nl
 ID:   40353
 User updated by:  des at envious dot nl
 Reported By:  des at envious dot nl
 Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: FreeBSD
 PHP Version:  4.4.4
 New Comment:

I see.

who can?


Previous Comments:


[2007-02-04 17:36:35] [EMAIL PROTECTED]

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

Weird or not, we can not change it.



[2007-02-04 16:33:12] des at envious dot nl

Description:

the STRPOS format is different than almost every other, which is to my
personal opinion odd. str_replace and in_array for example have the
source variable in the last part of the function (in_array($this,
$source), str_replace($this, $that, $source)) but strpos doesn't
(strpos($source,$this)). 

Isn't this odd?

Actual result:
--
strpos($this, $source);






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


#40353 [Opn->Bgs]: The format of strpos

2007-02-04 Thread derick
 ID:   40353
 Updated by:   [EMAIL PROTECTED]
 Reported By:  des at envious dot nl
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: FreeBSD
 PHP Version:  4.4.4
 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

Weird or not, we can not change it.


Previous Comments:


[2007-02-04 16:33:12] des at envious dot nl

Description:

the STRPOS format is different than almost every other, which is to my
personal opinion odd. str_replace and in_array for example have the
source variable in the last part of the function (in_array($this,
$source), str_replace($this, $that, $source)) but strpos doesn't
(strpos($source,$this)). 

Isn't this odd?

Actual result:
--
strpos($this, $source);






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


#40354 [NEW]: POST/GET Arrays won't initialize properly

2007-02-04 Thread andreyra at chtivo dot ru
From: andreyra at chtivo dot ru
Operating system: Windows 2003 Server
PHP version:  5.2.0
PHP Bug Type: Arrays related
Bug description:  POST/GET Arrays won't initialize properly

Description:

I have found strange behaviour with PHP POST/GET arrays. With print_r()
command I have see all contents of array, but if I trying to access to
values of array directly - I have got errors.

I have test this code with:
php5.1.2
php5.2.0
php5.2-win32-200702041530
Apache2.0.58/win32/php5apache2.dll
Apache2.2.3/win32/php5apache2_2.dll
Apache2.2.4/win32/php5apache2_2.dll

And always I have same results.

In my php.ini:
register_globals=   On
register_long_arrays=   On
register_argc_argv  =   On
post_max_size   =   512M


Reproduce code:
---


POST

$arr){
  print_r($arr);
  if (!isset($arr['name'])){
echo "\r\nERROR! NAME field is not set!\r\n";
continue;
   };
  echo 'OK.';
 };

?>

Expected result:

OK.

Actual result:
--
ERROR! NAME field is not set!

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


#40353 [NEW]: The format of strpos

2007-02-04 Thread des at envious dot nl
From: des at envious dot nl
Operating system: FreeBSD
PHP version:  4.4.4
PHP Bug Type: Feature/Change Request
Bug description:  The format of strpos

Description:

the STRPOS format is different than almost every other, which is to my
personal opinion odd. str_replace and in_array for example have the source
variable in the last part of the function (in_array($this, $source),
str_replace($this, $that, $source)) but strpos doesn't
(strpos($source,$this)). 

Isn't this odd?

Actual result:
--
strpos($this, $source);


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


#40352 [NEW]: FCGI_WEB_SERVER_ADDRS function get lost

2007-02-04 Thread xuefer at 21cn dot com
From: xuefer at 21cn dot com
Operating system: linux
PHP version:  5.2.1RC4
PHP Bug Type: CGI related
Bug description:  FCGI_WEB_SERVER_ADDRS function get lost

Description:

$ cd php-src/sapi/cgi/README.FastCGI
$ grep -rF FCGI_WEB_SERVER_ADDRS .
./README.FastCGI:variable FCGI_WEB_SERVER_ADDRS to control who can connect
to the FastCGI.
./README.FastCGI:export
FCGI_WEB_SERVER_ADDRS=199.170.183.28,199.170.183.71

hrm... an env variable that exists in read and nowhere in the source?
before php implement its new fcgi, it was supported by libfcgi.


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


#40137 [Bgs->Opn]: in-function-call variable-define bug

2007-02-04 Thread kolypto at mail dot ru
 ID:   40137
 User updated by:  kolypto at mail dot ru
 Reported By:  kolypto at mail dot ru
-Status:   Bogus
+Status:   Open
 Bug Type: Variables related
 Operating System: WinXP
 PHP Version:  5.2.0
 New Comment:

Found another thing, in manual:
int socket_select ( array &read, array &write, array &except, int
tv_sec [, int tv_usec] )

here's the amps before variables, that's exactly the same as spoken
above.

And what we see next, in manual?

$num_changed_sockets = socket_select($read, $write = NULL, $except =
NULL, 0);


so, the "bug" i'm complaining above is really strange...


Previous Comments:


[2007-01-16 21:50:55] kolypto at mail dot ru

Okay, i'll note that from 5.0.4 php has silently changed its
behavior...



[2007-01-16 08:27:48] [EMAIL PROTECTED]

Turn on error messages and see the error message you're missing:
"Strict Standards: Only variables should be passed by reference"

"$a='IN'" is not a variable, it's an expression and expressions cannot
be passed by reference.
No bug here.



[2007-01-16 03:42:37] kolypto at mail dot ru

In php4 and php 5.0.4 it is: 
In function:IN
MOD

In php > 5.0.4 it works like you're saying
that's the question =)



[2007-01-16 03:31:25] judas dot iscariote at gmail dot com

sigh. lets see..

function modify(&$str1)
{

print "\n".'In function:'.$str1;
$str1='MOD';

}

// the variable $a is locally **defined** with value "IN"
modify($a='IN'); //this prints 'In function: IN' (as expected)

print "\n".$a; // $a is **already defined** as 'IN', hence it SHOULD
print 'IN' **not** MOD

wth are you talking about ?? works as expected.



[2007-01-15 22:23:05] kolypto at mail dot ru

Recent research: in 5.0.4 this code works as expected:



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/40137

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


#40351 [NEW]: DNS resolution fails with PHP

2007-02-04 Thread dae at datasec dot no
From: dae at datasec dot no
Operating system: Trustix 3.0.5 RC1
PHP version:  4.4.4
PHP Bug Type: *Network Functions
Bug description:  DNS resolution fails with PHP

Description:

PHP can not do DNS-resolution,
all other software or parts of the OS can.

Reproduce code:
---
$foo = gethostbyaddr('69.147.83.197');
echo 'gethostbyaddr [should show a hostname] : '.$foo."\n";

$foo = gethostbyname("php.net");
echo 'gethostbyname [should show an ip] : '.$foo."\n";

$host = explode('@', '[EMAIL PROTECTED]');
if(!checkdnsrr($host[1].'.', 'MX') ) {
echo "No MX record found for [EMAIL PROTECTED]";
}

Expected result:

gethostbyaddr [should show a hostname] : y2.php.net
gethostbyname [should show an ip] : 69.147.83.197

Actual result:
--
gethostbyaddr [should show a hostname] : 69.147.83.197
gethostbyname [should show an ip] : php.net
No MX record found for [EMAIL PROTECTED]

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


#40348 [Opn->Bgs]: Reading of private/protected properties should be allowed for Reflection API

2007-02-04 Thread helly
 ID:   40348
 Updated by:   [EMAIL PROTECTED]
 Reported By:  thc at forestfactory dot de
-Status:   Open
+Status:   Bogus
 Bug Type: Class/Object related
-Operating System: any
+Operating System: *
-PHP Version:  5.2.0
+PHP Version:  *
 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

Use var_dump


Previous Comments:


[2007-02-04 06:54:30] thc at forestfactory dot de

Description:

"Fixing" "bug" #37816 in PHP 5.2.0 made Reflection more or less useless
for the one purpose I used it for: reverse-engineering  and debugging.
While I can understand that there might be a reason for disallowing
"setValue" on private/protected properties, why shouldn't I be allowed
to read the value of a property? 

I wrote a nice debugger/reflection class for 5.1.x which stopped
working now. And what will I do? I will use print_r() or var_export()
and parse the output using regular expressions or something to get the
value. So what is the point of this? I still get the value. You just
made my code less readable and more performance consuming

IMHO this was never a bug! And as #24852 mentions it isn't a bug that
print_r() gives access to values of non-public properties

Regards Thomas






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