Re: [PHP] How to get a PHP bug fixed?

2012-11-17 Thread Iñigo Medina


On Sat, 17 Nov 2012, Enumag wrote:


Hi, there is a bug I'd like to be fixed and even a patch is available. But
there is still no reaction at all after 2 years. What else can I do to get
the bug fixed?

https://bugs.php.net/bug.php?id=45351 - patch available from 2010-06-13
https://bugs.php.net/bug.php?id=48724 - patch available from 2012-04-13


It looks like there is a thread about that on the PHP Bugzilla, but it is not
admitted as a patch to be accepted. Maybe you might try by GitHub, making
a pull request.

iñ



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

Re: [PHP] How to get a PHP bug fixed?

2012-11-17 Thread Daniel Brown
On Sat, Nov 17, 2012 at 1:51 AM, Enumag enu...@gmail.com wrote:
 Hi, there is a bug I'd like to be fixed and even a patch is available. But
 there is still no reaction at all after 2 years. What else can I do to get
 the bug fixed?

 https://bugs.php.net/bug.php?id=45351 - patch available from 2010-06-13
 https://bugs.php.net/bug.php?id=48724 - patch available from 2012-04-13

The PHP General mailing list is only for discussing the use of the
language and developing in PHP, not really for the development of the
language itself.  Instead, you should try to discuss these things on
the PHP Internals list at intern...@lists.php.net.  You may also want
to speak with some of the developers via IRC on EFnet #php.pecl to
discuss if there is any interest in patching the bugs you've
mentioned.

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



[PHP] How to get a PHP bug fixed?

2012-11-16 Thread Enumag
Hi, there is a bug I'd like to be fixed and even a patch is available. But
there is still no reaction at all after 2 years. What else can I do to get
the bug fixed?

https://bugs.php.net/bug.php?id=45351 - patch available from 2010-06-13
https://bugs.php.net/bug.php?id=48724 - patch available from 2012-04-13


[PHP] Bug in DOMDocument schemaValidate() function?

2012-05-14 Thread Voß , Marko
Hello,

I am validating user DOM against schema files using the following piece of code:

$valid = @$doc-schemaValidate($xsdFile);

where $doc is of type DOMDocument and $xsdFile is the file location of the XSD 
file.

Everything worked fine until the following validation occured:

A validation of a XML against the SRW/U schema 
(http://www.loc.gov/standards/sru/sru1-1archive/xml-files/srw-types.xsd) 
failed.

Here is the XML:

-
?xml version=1.0 encoding=UTF-8?
srw:explainResponse xmlns:srw=http://www.loc.gov/zing/srw/; 
xmlns:zr=http://explain.z3950.org/dtd/2.0/;
   srw:version1.1/srw:version
   srw:record
 srw:recordSchemahttp://explain.z3950.org/dtd/2.0//srw:recordSchema
 srw:recordPackingXML/srw:recordPacking
 srw:recordData
   zr:explain
 zr:serverInfo wsdl=http://myserver.com/db; protocol=SRU 
version=1.1
   hostmyserver.com/host
   port80/port
   databasesru/database
 /zr:serverInfo
 zr:databaseInfo
   title lang=en primary=trueSRU Test Database/title
   description lang=en primary=true My server SRU Test 
Database/description
 /zr:databaseInfo
 zr:metaInfo
   dateModified27-11-2003/dateModified
 /zr:metaInfo
   /zr:explain
 /srw:recordData
   /srw:record
/srw:explainResponse
-

This XML is valid. However, I keep getting the following libxml error:

object(LibXMLError)#192 (6) {
 [level]=
 int(2)
 [code]=
 int(1871)
 [column]=
 int(0)
 [message]=
 string(133) Element '{http://www.loc.gov/zing/srw/}record': This element 
is not expected. Expected is ( 
{http://www.loc.gov/zing/srw/}version ).

 [file]=
 string(0) 
 [line]=
 int(0)
}

I think, the validator is unable to handle the xsd:extension part of the schema:

xsd:complexType name=explainResponseType
   xsd:complexContent
 xsd:extension base=responseType
   xsd:sequencexsd:element ref=record/
 xsd:element ref=echoedExplainRequest minOccurs=0/
 xsd:element ref=diagnostics minOccurs=0/
 xsd:element ref=extraResponseData minOccurs=0/
   /xsd:sequence
 /xsd:extension
   /xsd:complexContent
/xsd:complexType

The version-element exists and is at the right place. If I add another 
version-element after the first one, it complains 
about expecting a record-element instead, which is correct. But it is not 
correct to expect another version-element 
after the already existing one.

Is this a bug? Or did I made a mistake somewhere and I am not able to see it 
right now?


Thank you for any help!

Best regards,
Marko


---

Fachinformationszentrum Karlsruhe, Gesellschaft für wissenschaftlich-technische 
Information mbH. 
Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB 
101892. 
Geschäftsführerin: Sabine Brünger-Weilandt. 
Vorsitzender des Aufsichtsrats: MinDirig Dr. Thomas Greiner.



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



Re: [PHP] Bug in DOMDocument schemaValidate() function?

2012-05-14 Thread Matijn Woudt
On Mon, May 14, 2012 at 1:39 PM, Voß, Marko marko.v...@fiz-karlsruhe.de wrote:
 Hello,

 I am validating user DOM against schema files using the following piece of 
 code:

 $valid = @$doc-schemaValidate($xsdFile);

 where $doc is of type DOMDocument and $xsdFile is the file location of the 
 XSD file.

 Everything worked fine until the following validation occured:

 A validation of a XML against the SRW/U schema 
 (http://www.loc.gov/standards/sru/sru1-1archive/xml-files/srw-types.xsd)
 failed.

 Here is the XML:

 -
 ?xml version=1.0 encoding=UTF-8?
 srw:explainResponse xmlns:srw=http://www.loc.gov/zing/srw/; 
 xmlns:zr=http://explain.z3950.org/dtd/2.0/;
   srw:version1.1/srw:version
   srw:record
     srw:recordSchemahttp://explain.z3950.org/dtd/2.0//srw:recordSchema
     srw:recordPackingXML/srw:recordPacking
     srw:recordData
       zr:explain
         zr:serverInfo wsdl=http://myserver.com/db; protocol=SRU 
 version=1.1
           hostmyserver.com/host
           port80/port
           databasesru/database
         /zr:serverInfo
         zr:databaseInfo
           title lang=en primary=trueSRU Test Database/title
           description lang=en primary=true My server SRU Test 
 Database/description
         /zr:databaseInfo
         zr:metaInfo
           dateModified27-11-2003/dateModified
         /zr:metaInfo
       /zr:explain
     /srw:recordData
   /srw:record
 /srw:explainResponse
 -

 This XML is valid. However, I keep getting the following libxml error:

 object(LibXMLError)#192 (6) {
     [level]=
     int(2)
     [code]=
     int(1871)
     [column]=
     int(0)
     [message]=
     string(133) Element '{http://www.loc.gov/zing/srw/}record': This element 
 is not expected. Expected is (
 {http://www.loc.gov/zing/srw/}version ).
 
     [file]=
     string(0) 
     [line]=
     int(0)
 }

 I think, the validator is unable to handle the xsd:extension part of the 
 schema:

 xsd:complexType name=explainResponseType
   xsd:complexContent
     xsd:extension base=responseType
       xsd:sequencexsd:element ref=record/
         xsd:element ref=echoedExplainRequest minOccurs=0/
         xsd:element ref=diagnostics minOccurs=0/
         xsd:element ref=extraResponseData minOccurs=0/
       /xsd:sequence
     /xsd:extension
   /xsd:complexContent
 /xsd:complexType

 The version-element exists and is at the right place. If I add another 
 version-element after the first one, it complains
 about expecting a record-element instead, which is correct. But it is not 
 correct to expect another version-element
 after the already existing one.

 Is this a bug? Or did I made a mistake somewhere and I am not able to see it 
 right now?


 Thank you for any help!

 Best regards,
 Marko


If you're 100% sure this XML is valid, then this is a bug. You should
report it at bugs.php.net, but it is most likely this bug is in
libXML, and needs to be fixed there.

- Matijn

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



Re: [PHP] Bug in DOMDocument schemaValidate() function?

2012-05-14 Thread Voß , Marko
Hello,

I am sorry, but everything is ok here. I am performing an unmarshalling and 
marshalling unit test for every resource and 
the problem was, that after unmarshalling to the object, the marshalling of the 
object did not create the version 
element. I did not notice this in the first place.

So the validation error occured after the step of testing the marshalling and 
not before testing the unmarshalling.

Thank you anyways!

Best regards,
Marko

Am 14.05.2012 16:43, schrieb Matijn Woudt:
 On Mon, May 14, 2012 at 1:39 PM, Voß, Markomarko.v...@fiz-karlsruhe.de  
 wrote:
 Hello,

 I am validating user DOM against schema files using the following piece of 
 code:

 $valid = @$doc-schemaValidate($xsdFile);

 where $doc is of type DOMDocument and $xsdFile is the file location of the 
 XSD file.

 Everything worked fine until the following validation occured:

 A validation of a XML against the SRW/U schema 
 (http://www.loc.gov/standards/sru/sru1-1archive/xml-files/srw-types.xsd)
 failed.

 Here is the XML:

 -
 ?xml version=1.0 encoding=UTF-8?
 srw:explainResponse xmlns:srw=http://www.loc.gov/zing/srw/; 
 xmlns:zr=http://explain.z3950.org/dtd/2.0/;
srw:version1.1/srw:version
srw:record
  srw:recordSchemahttp://explain.z3950.org/dtd/2.0//srw:recordSchema
  srw:recordPackingXML/srw:recordPacking
  srw:recordData
zr:explain
  zr:serverInfo wsdl=http://myserver.com/db; protocol=SRU 
 version=1.1
hostmyserver.com/host
port80/port
databasesru/database
  /zr:serverInfo
  zr:databaseInfo
title lang=en primary=trueSRU Test Database/title
description lang=en primary=true  My server SRU Test 
 Database/description
  /zr:databaseInfo
  zr:metaInfo
dateModified27-11-2003/dateModified
  /zr:metaInfo
/zr:explain
  /srw:recordData
/srw:record
 /srw:explainResponse
 -

 This XML is valid. However, I keep getting the following libxml error:

 object(LibXMLError)#192 (6) {
  [level]=
  int(2)
  [code]=
  int(1871)
  [column]=
  int(0)
  [message]=
  string(133) Element '{http://www.loc.gov/zing/srw/}record': This 
 element is not expected. Expected is (
 {http://www.loc.gov/zing/srw/}version ).
 
  [file]=
  string(0) 
  [line]=
  int(0)
 }

 I think, the validator is unable to handle the xsd:extension part of the 
 schema:

 xsd:complexType name=explainResponseType
xsd:complexContent
  xsd:extension base=responseType
xsd:sequencexsd:element ref=record/
  xsd:element ref=echoedExplainRequest minOccurs=0/
  xsd:element ref=diagnostics minOccurs=0/
  xsd:element ref=extraResponseData minOccurs=0/
/xsd:sequence
  /xsd:extension
/xsd:complexContent
 /xsd:complexType

 The version-element exists and is at the right place. If I add another 
 version-element after the first one, it complains
 about expecting a record-element instead, which is correct. But it is not 
 correct to expect another version-element
 after the already existing one.

 Is this a bug? Or did I made a mistake somewhere and I am not able to see it 
 right now?


 Thank you for any help!

 Best regards,
 Marko


 If you're 100% sure this XML is valid, then this is a bug. You should
 report it at bugs.php.net, but it is most likely this bug is in
 libXML, and needs to be fixed there.

 - Matijn


---

Fachinformationszentrum Karlsruhe, Gesellschaft für wissenschaftlich-technische 
Information mbH. 
Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB 
101892. 
Geschäftsführerin: Sabine Brünger-Weilandt. 
Vorsitzender des Aufsichtsrats: MinDirig Dr. Thomas Greiner.



Re: [PHP] Bug zlib.output_compression not normal work in IIS7.5

2012-03-28 Thread 小鱼虾
Because php5.4 compression not normal work. So I have to enable IIS7.5 system 
compression.  ok. now please check the www.ongod.org/test/phpinfo.php site. 
just now I have  close IIS compression. PHP5.4 sure can't work with 
zlib.output_compression.
windows php enable by default.
Now I have study try building php5.4 x64 by myself. but I can't building php 
ext. only building success php 5.4.1 main code.Who will tell me how building 
full php5.4.x ? 
-- Original --
From:  Simon Schicksimonsimc...@googlemail.com;
Date:  Wed, Mar 21, 2012 03:21 PM
To:  小鱼虾i...@xiaoyu.org; 
Cc:  php-generalphp-general@lists.php.net; 
Subject:  Re: [PHP] Bug zlib.output_compression not normal work in IIS7.5

 
2012/3/19 小鱼虾 i...@xiaoyu.org

 How I do fix it ?


 https://bugs.php.net/bug.php?id=61434


Hi,

I got a rough overview of the conversation in the bug-tracker ...

You were always talking about a tool you used to test the
gzip-compression ... but why not test it natively?
Using Firefox (with the extension Firebug) or Safari / Chrome for
example you can easily view the respond-header from the server and get
more info out of that.
Just press F12, click on the network-tab, select your request and
search in the response-header for Content-Encoding: ...

I would write my own small php-test-script where you just output some
text. Then you're sure that not other code is doing something strange.

Another possible problem: Is the extension zlib enabled at all? The
documentation says that it's disabled by default ...
http://www.php.net/manual/en/zlib.installation.php

Bye
Simon

Re: [PHP] Bug zlib.output_compression not normal work in IIS7.5

2012-03-21 Thread Simon Schick
2012/3/19 小鱼虾 i...@xiaoyu.org

 How I do fix it ?


 https://bugs.php.net/bug.php?id=61434


Hi,

I got a rough overview of the conversation in the bug-tracker ...

You were always talking about a tool you used to test the
gzip-compression ... but why not test it natively?
Using Firefox (with the extension Firebug) or Safari / Chrome for
example you can easily view the respond-header from the server and get
more info out of that.
Just press F12, click on the network-tab, select your request and
search in the response-header for Content-Encoding: ...

I would write my own small php-test-script where you just output some
text. Then you're sure that not other code is doing something strange.

Another possible problem: Is the extension zlib enabled at all? The
documentation says that it's disabled by default ...
http://www.php.net/manual/en/zlib.installation.php

Bye
Simon

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



[PHP] Bug zlib.output_compression not normal work in IIS7.5

2012-03-20 Thread 小鱼虾
How I do fix it ?


https://bugs.php.net/bug.php?id=61434 




ID: 61434  User updated by:info at ongod dot org  Reported 
by:info at ongod dot org  Summary:zlib.output_compression 
not normal work in IIS7.5  Status: Not a bug  Type:   
Bug  Package:Zlib related  Operating System:   windows2008R2x64  
PHP Version:5.4.0  Block user comment: N  Private report: N  New 
Comment: it is Should be clean code for check. php5.4 not normal work.  but 
php5.3.10  normal work in the same server.  who tell me why this ? 
http://www.ongod.org/test/phpinfo.php Web page compressed?  No Compression 
type?none Size, Markup (bytes)   83,611 Size, Compressed (bytes) 0 
Compression % 0.0 php5.3.10 http://mail.ipv6china.com/phpinfo.php Web page 
compressed?Yes Compression type?   gzip Size, Markup (bytes)   
87,124 Size, Compressed (bytes) 13,730 Compression %84.2 check from 
http://www.gidnetwork.com/tools/gzip-test.php Previous Comments: 
 
[2012-03-19 14:14:54] paj...@php.net ok, not a bug but a support issue. @info 
at ongod dot org Please ask further support on the PHP general mailing list or 
any other support  channel, thanks! 
 
[2012-03-19 14:10:56] a...@php.net I cannot reproduce the issue, tried with the 
latest php 5.4 and IIS7. IIS7 has  compression turned off and the php.ini has 
both zlib.output_compression=on and  zlib.output_compression_level=-1 set. The 
page is merely a phpinfo() page. Here  the simple ping pong: GET /i.php 
HTTP/1.1 Host: localhost Connection: keep-alive Cache-Control: max-age=0 
User-Agent: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/535.11 (KHTML, like Gecko) 
 Chrome/17.0.963.79 Safari/535.11 Accept: 
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 
Accept-Encoding: gzip,deflate,sdch Accept-Language: 
de-DE,de;q=0.8,en-US;q=0.6,en;q=0.4 Accept-Charset: 
ISO-8859-1,utf-8;q=0.7,*;q=0.3 HTTP/1.1 200 OK Content-Type: text/html 
Content-Encoding: gzip Vary: Accept-Encoding Server: Microsoft-IIS/7.5 
X-Powered-By: PHP/5.4.1RC1-dev Date: Mon, 19 Mar 2012 14:00:09 GMT 
Content-Length: 6182 The output compression seems to work.  @info at ongod dot 
org Could you please try such a simple page scenario and post the 
request/response  headers? 
 
[2012-03-19 14:01:26] nacin at wordpress dot org I can confirm that WordPress 
3.3.1 does not set zlib.output_compression. Looks  like WP never has. 
 
[2012-03-19 11:40:20] info at ongod dot org Security reasons, I would also send 
an email to you. 
 
[2012-03-19 11:25:40] m...@php.net zlib.output_compression can be disabled at 
runtime at later stage in PHP 5.4. I'd probably be lost on a Windows box, so I 
don't think I could help you there. 
 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 
https://bugs.php.net/bug.php?id=61434

Re: [PHP] Bug 51860

2012-01-18 Thread Matijn Woudt
On Wed, Jan 18, 2012 at 1:06 AM, Christian Grobmeier
grobme...@gmail.com wrote:
 Hello folks,

 any chance this one is ever fixed?
 https://bugs.php.net/bug.php?id=51860

 I am a customer of 11. They told me they will not upgrade until this
 one is fixed. Imagine that there are thousands of customers running
 php 5.2.17 just because of this issue. Unfortunately I am not able to
 fix this on myself - my C-fu is not good enough.

 Because big hosters like 11 do not upgrade, we (the Apache log4php
 team) cannot make use of newer PHP versions too. We have decided to
 use the features once we see the old hosters move on. Same is true for
 other projects of mine. If we would upgrade we loose all the people on
 the big hosting companies.

 I think it is in the interest of the PHP-dev team to see people moving
 on. Otherwise at someday software like phpBB, wordpress et al will not
 work on many hosts at some day in future.

 Not sure if there has been any plans on this issue - i am very much
 interested in this and would like know if it is already on the
 schedule.

 Thanks,
 Christian

This list is for users having problems with PHP scripts etc. If you
want to contact the devs, you're on the wrong mailing list (there's a
special one for it)

Matijn

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



[PHP] Bug 51860

2012-01-17 Thread Christian Grobmeier
Hello folks,

any chance this one is ever fixed?
https://bugs.php.net/bug.php?id=51860

I am a customer of 11. They told me they will not upgrade until this
one is fixed. Imagine that there are thousands of customers running
php 5.2.17 just because of this issue. Unfortunately I am not able to
fix this on myself - my C-fu is not good enough.

Because big hosters like 11 do not upgrade, we (the Apache log4php
team) cannot make use of newer PHP versions too. We have decided to
use the features once we see the old hosters move on. Same is true for
other projects of mine. If we would upgrade we loose all the people on
the big hosting companies.

I think it is in the interest of the PHP-dev team to see people moving
on. Otherwise at someday software like phpBB, wordpress et al will not
work on many hosts at some day in future.

Not sure if there has been any plans on this issue - i am very much
interested in this and would like know if it is already on the
schedule.

Thanks,
Christian

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



Re: [PHP] Re: Think I found a PHP bug

2011-12-09 Thread Lester Caine

Rasmus Lerdorf wrote:

This is fixed in PHP 5.4 by completely dropping support for the TZ
environment variable. PHP will always use UTC unless you explicitly set
it to something. It won't matter which timezone the system is running
in. This is the only reliable way to always have consistent behaviour
across all environments.


Just taking that a step further ...
The second that you need to actually take a users time zone into consideration, 
then the best way of working is to RUN the sever set to UTC. And store any time 
information in UTC. Then you can display times TO USERS either as UTC, or as 
their own local time or the local time of the location an event is happening at. 
You just need to remember that timezone information provided by the browser is 
only todays time offset, so any area with daylight saving will be wrong for half 
of the year, so that is the point you need to store a user or loction timezone 
reference. Many systems still only store 'offset' which is simply wrong :)


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

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



Re: [PHP] Re: Think I found a PHP bug

2011-12-08 Thread Rasmus Lerdorf
This is fixed in PHP 5.4 by completely dropping support for the TZ
environment variable. PHP will always use UTC unless you explicitly set
it to something. It won't matter which timezone the system is running
in. This is the only reliable way to always have consistent behaviour
across all environments.

-Rasmus

On 12/06/2011 04:46 PM, Patricia Dewald wrote:
 
 In OpenSuSE 12.1 i can reproduce this issue.
 
 My workaround is to check the correct timezone.
 
 On Tue, 15 Nov 2011 23:34:18 +0100, Geoff Shang ge...@quitelikely.com
 wrote:
 
 Hi,

 A couple of weeks ago, I discovered what I'm pretty sure is a PHP bug.
 In addition, I looked in the PHP changelog and I haven't seen any
 mention of a fix for it.

 I'm writing here because I was wondering if anyone else can confirm it
 and what to do about it.

 The bug is that if a server's timezone is set to Europe/London and you
 don't set an explicit timezone in your script, if it's winter time in
 the UK, PHP thinks the timezone is UTC instead of Europe/London.

 Example:

 First, lets confirm that the system time is in fact set to Europe/London.

 $ cmp --verbose /etc/localtime /usr/share/zoneinfo/Europe/London
 $ echo $?
 0

 Now lets see what PHP thinks it is.

 $ php -r 'echo date_default_timezone_get();'
 UTC

 What about if we set it in the environment?

 $ export TZ=Europe/London
 $ php -r 'echo date_default_timezone_get();'
 Europe/London

 OK, so we appear to have an issue.  But is this just semantics?  Well
 no. consider the following (with TZ once again unset):

 $ php -r 'echo date (r, strtotime (1 July 2011 12:00 pm'
 Fri, 01 Jul 2011 12:00:00 +

 But of course, Europe/London isn't on + in July.

 $ export TZ=Europe/London
 $ php -r 'echo date (r, strtotime (1 July 2011 12:00 pm));'
 Fri, 01 Jul 2011 12:00:00 +0100

 The problem comes in when we view times created in one and printed in
 the other:

 $ unset TZ
 $ php -r 'echo strtotime (1 July 2011 12:00 pm);'
 1309521600
 $ export TZ=Europe/London
 $ php -r 'echo date (r, 1309521600);'
 Fri, 01 Jul 2011 13:00:00 +0100

 And the opposite:

 $ export TZ=Europe/London
 $ php -r 'echo strtotime (1 July 2011 12:00 pm);'
 1309518000
 $ unset TZ
 $ php -r 'echo date (r, 1309518000);'
 Fri, 01 Jul 2011 11:00:00 +

 This last one is what led me to discover this bug.  We use automation
 software to run our Internet radio station.  The playout system is
 written in C and the web front-end is written in PHP, with the data
 they work on the only point of commonality between them.  The station
 was set up during the European summer.  When the clocks changed, the
 playout system coped but the PHP front-end was showing everything an
 hour out.

 Now of course, I personally can force the front-end to use
 Europe/London and it will work for me.  And I guess ultimately it
 would make sense to program the system to allow the user to specify a
 timezone rather than relying on the server default.  But right now it
 doesn't, and any solution would need to take the playout system into
 account.

 At any rate, none of this is the point.  If you're using the system
 default timezone, you expect it to (a) be correct and (b) be consistant.

 Note that this bug may affect other timezones which are on UTC durin
 the winter or summer, but I've not tested any other timezones as this
 would mean changing the system timezone and I'm not real keen on doing
 that on any of my systems.

 This bug was found on a Debian Squeeze system running the following
 version of PHP:

 PHP 5.3.3-7+squeeze3 with Suhosin-Patch (cli) (built: Jun 28 2011
 08:24:40)
 Copyright (c) 1997-2009 The PHP Group
 Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

 I realise this is 5.3.3 and that 5.3.8 is now out.  It's possible that
 this has been fixed but I could not find any traces of such a fix in
 the changelogs.

 I'd be interested to know if anyone else can confirm this bug and, if
 confirmed, what I should do about it.

 Thanks,
 Geoff.

 
 


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



[PHP] Re: Think I found a PHP bug

2011-12-06 Thread Patricia Dewald


In OpenSuSE 12.1 i can reproduce this issue.

My workaround is to check the correct timezone.

On Tue, 15 Nov 2011 23:34:18 +0100, Geoff Shang ge...@quitelikely.com  
wrote:



Hi,

A couple of weeks ago, I discovered what I'm pretty sure is a PHP bug.  
In addition, I looked in the PHP changelog and I haven't seen any  
mention of a fix for it.


I'm writing here because I was wondering if anyone else can confirm it  
and what to do about it.


The bug is that if a server's timezone is set to Europe/London and you  
don't set an explicit timezone in your script, if it's winter time in  
the UK, PHP thinks the timezone is UTC instead of Europe/London.


Example:

First, lets confirm that the system time is in fact set to Europe/London.

$ cmp --verbose /etc/localtime /usr/share/zoneinfo/Europe/London
$ echo $?
0

Now lets see what PHP thinks it is.

$ php -r 'echo date_default_timezone_get();'
UTC

What about if we set it in the environment?

$ export TZ=Europe/London
$ php -r 'echo date_default_timezone_get();'
Europe/London

OK, so we appear to have an issue.  But is this just semantics?  Well  
no. consider the following (with TZ once again unset):


$ php -r 'echo date (r, strtotime (1 July 2011 12:00 pm'
Fri, 01 Jul 2011 12:00:00 +

But of course, Europe/London isn't on + in July.

$ export TZ=Europe/London
$ php -r 'echo date (r, strtotime (1 July 2011 12:00 pm));'
Fri, 01 Jul 2011 12:00:00 +0100

The problem comes in when we view times created in one and printed in  
the other:


$ unset TZ
$ php -r 'echo strtotime (1 July 2011 12:00 pm);'
1309521600
$ export TZ=Europe/London
$ php -r 'echo date (r, 1309521600);'
Fri, 01 Jul 2011 13:00:00 +0100

And the opposite:

$ export TZ=Europe/London
$ php -r 'echo strtotime (1 July 2011 12:00 pm);'
1309518000
$ unset TZ
$ php -r 'echo date (r, 1309518000);'
Fri, 01 Jul 2011 11:00:00 +

This last one is what led me to discover this bug.  We use automation  
software to run our Internet radio station.  The playout system is  
written in C and the web front-end is written in PHP, with the data they  
work on the only point of commonality between them.  The station was set  
up during the European summer.  When the clocks changed, the playout  
system coped but the PHP front-end was showing everything an hour out.


Now of course, I personally can force the front-end to use Europe/London  
and it will work for me.  And I guess ultimately it would make sense to  
program the system to allow the user to specify a timezone rather than  
relying on the server default.  But right now it doesn't, and any  
solution would need to take the playout system into account.


At any rate, none of this is the point.  If you're using the system  
default timezone, you expect it to (a) be correct and (b) be consistant.


Note that this bug may affect other timezones which are on UTC durin the  
winter or summer, but I've not tested any other timezones as this would  
mean changing the system timezone and I'm not real keen on doing that on  
any of my systems.


This bug was found on a Debian Squeeze system running the following  
version of PHP:


PHP 5.3.3-7+squeeze3 with Suhosin-Patch (cli) (built: Jun 28 2011  
08:24:40)

Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

I realise this is 5.3.3 and that 5.3.8 is now out.  It's possible that  
this has been fixed but I could not find any traces of such a fix in the  
changelogs.


I'd be interested to know if anyone else can confirm this bug and, if  
confirmed, what I should do about it.


Thanks,
Geoff.




--
best regards,
Patty

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



Re: Re: [PHP] Think I found a PHP bug

2011-11-17 Thread Tim Streater
On 16 Nov 2011 at 16:30, Geoff Shang ge...@quitelikely.com wrote: 

 On Wed, 15 Nov 2011, Tim Streater wrote:

 I find I need to do this:

  date_default_timezone_set (@date_default_timezone_get ());

 in all my scripts since 5.x.x to avoid rude messages.

 Apart from the fact that I've not seen the rude messages of which you
 speak, even though I expected to, this won't help in this case.
 date_default_timezone_get() is returning the wrong timezone.

Here's what I would otherwise get:

Warning: date(): It is not safe to rely on the system's timezone settings. You 
are *required* to use the date.timezone setting or the 
date_default_timezone_set() function. In case you used any of those methods and 
you are still getting this warning, you most likely misspelled the timezone 
identifier. We selected 'UTC' for 'GMT/0.0/no DST' instead in /Users/tim/

--
Cheers  --  Tim

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

Re: [PHP] Think I found a PHP bug

2011-11-16 Thread Geoff Shang

On Tue, 15 Nov 2011, Jim Lucas wrote:


Also, I recalled something from the early 5.1.0 version that was related to the
introduction of the date_timezone_set() function.  So, from there I searched
Google for php changelog and found the changelog for php v5.  Then I searched
that document for 'date_' and found that under the 5.1.0 they added the above
function.  How it is stated, it makes me think that PHP now requires you to call
this function prior to any use of other date functions.  I cannot find anything
in the php manual confirming my last statement.  YMMV


If you don't use date_default_timezone_set(), it's supposed to use the 
server timezone.  I recalled reading that a notice/warning would be logged 
if you did this, but like you, I can't find any reference to this now. 
I've searched my apache error logs and can't find anything there either, 
which seems to suggest that this in fact is not the case.


In case it wasn't obvious in my original post, this worked just fine 
during UK summer time.  It's only since the clocks changed two weeks ago 
that PHP has been thinking that the server timezone is UTC rather than 
Europe/London.


Geoff.


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



Re: [PHP] Think I found a PHP bug

2011-11-16 Thread Geoff Shang

On Wed, 15 Nov 2011, Tim Streater wrote:


I find I need to do this:

 date_default_timezone_set (@date_default_timezone_get ());

in all my scripts since 5.x.x to avoid rude messages.


Apart from the fact that I've not seen the rude messages of which you 
speak, even though I expected to, this won't help in this case. 
date_default_timezone_get() is returning the wrong timezone.


Geoff.


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



[PHP] Think I found a PHP bug

2011-11-15 Thread Geoff Shang

Hi,

A couple of weeks ago, I discovered what I'm pretty sure is a PHP bug. 
In addition, I looked in the PHP changelog and I haven't seen any mention 
of a fix for it.


I'm writing here because I was wondering if anyone else can confirm it and 
what to do about it.


The bug is that if a server's timezone is set to Europe/London and you 
don't set an explicit timezone in your script, if it's winter time in 
the UK, PHP thinks the timezone is UTC instead of Europe/London.


Example:

First, lets confirm that the system time is in fact set to Europe/London.

$ cmp --verbose /etc/localtime /usr/share/zoneinfo/Europe/London
$ echo $?
0

Now lets see what PHP thinks it is.

$ php -r 'echo date_default_timezone_get();'
UTC

What about if we set it in the environment?

$ export TZ=Europe/London
$ php -r 'echo date_default_timezone_get();'
Europe/London

OK, so we appear to have an issue.  But is this just semantics?  Well no. 
consider the following (with TZ once again unset):


$ php -r 'echo date (r, strtotime (1 July 2011 12:00 pm'
Fri, 01 Jul 2011 12:00:00 +

But of course, Europe/London isn't on + in July.

$ export TZ=Europe/London
$ php -r 'echo date (r, strtotime (1 July 2011 12:00 pm));'
Fri, 01 Jul 2011 12:00:00 +0100

The problem comes in when we view times created in one and printed in 
the other:


$ unset TZ
$ php -r 'echo strtotime (1 July 2011 12:00 pm);'
1309521600
$ export TZ=Europe/London
$ php -r 'echo date (r, 1309521600);'
Fri, 01 Jul 2011 13:00:00 +0100

And the opposite:

$ export TZ=Europe/London
$ php -r 'echo strtotime (1 July 2011 12:00 pm);'
1309518000
$ unset TZ
$ php -r 'echo date (r, 1309518000);'
Fri, 01 Jul 2011 11:00:00 +

This last one is what led me to discover this bug.  We use automation 
software to run our Internet radio station.  The playout system is written 
in C and the web front-end is written in PHP, with the data they work on 
the only point of commonality between them.  The station was set up during 
the European summer.  When the clocks changed, the playout system coped 
but the PHP front-end was showing everything an hour out.


Now of course, I personally can force the front-end to use Europe/London 
and it will work for me.  And I guess ultimately it would make sense to 
program the system to allow the user to specify a timezone rather than 
relying on the server default.  But right now it doesn't, and any solution 
would need to take the playout system into account.


At any rate, none of this is the point.  If you're using the system 
default timezone, you expect it to (a) be correct and (b) be consistant.


Note that this bug may affect other timezones which are on UTC durin the 
winter or summer, but I've not tested any other timezones as this would 
mean changing the system timezone and I'm not real keen on doing that on 
any of my systems.


This bug was found on a Debian Squeeze system running the following 
version of PHP:


PHP 5.3.3-7+squeeze3 with Suhosin-Patch (cli) (built: Jun 28 2011 
08:24:40)

Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

I realise this is 5.3.3 and that 5.3.8 is now out.  It's possible that 
this has been fixed but I could not find any traces of such a fix in the 
changelogs.


I'd be interested to know if anyone else can confirm this bug and, if 
confirmed, what I should do about it.


Thanks,
Geoff.


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



Re: [PHP] Think I found a PHP bug

2011-11-15 Thread Tim Streater
On 15 Nov 2011 at 22:34, Geoff Shang ge...@quitelikely.com wrote: 

 The bug is that if a server's timezone is set to Europe/London and you
 don't set an explicit timezone in your script, if it's winter time in
 the UK, PHP thinks the timezone is UTC instead of Europe/London.

I find I need to do this:

  date_default_timezone_set (@date_default_timezone_get ());

in all my scripts since 5.x.x to avoid rude messages.

--
Cheers  --  Tim

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

Re: [PHP] Think I found a PHP bug

2011-11-15 Thread Jim Lucas
On 11/15/2011 2:58 PM, Tim Streater wrote:
 On 15 Nov 2011 at 22:34, Geoff Shang ge...@quitelikely.com wrote: 
 
 The bug is that if a server's timezone is set to Europe/London and you
 don't set an explicit timezone in your script, if it's winter time in
 the UK, PHP thinks the timezone is UTC instead of Europe/London.
 
 I find I need to do this:
 
   date_default_timezone_set (@date_default_timezone_get ());
 
 in all my scripts since 5.x.x to avoid rude messages.
 
 --
 Cheers  --  Tim
 
 

Also, I recalled something from the early 5.1.0 version that was related to the
introduction of the date_timezone_set() function.  So, from there I searched
Google for php changelog and found the changelog for php v5.  Then I searched
that document for 'date_' and found that under the 5.1.0 they added the above
function.  How it is stated, it makes me think that PHP now requires you to call
this function prior to any use of other date functions.  I cannot find anything
in the php manual confirming my last statement.  YMMV

1 http://us3.php.net/manual/en/function.date-timezone-set.php
2 http://php.net/ChangeLog-5.php#5.1.0

-- 
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
http://www.bendsource.com/

C - (541) 408-5189
O - (541) 323-9113
H - (541) 323-4219

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



Re: [PHP] Bug?

2011-09-18 Thread Robert Stone





De: Igor Escobar titiolin...@gmail.com
Para: php-general@lists.php.net php-general@lists.php.net
Enviadas: Sexta-feira, 16 de Setembro de 2011 7:07
Assunto: [PHP] Bug?

Anyone can explain this?

https://gist.github.com/1220404

Part of the code are in portuguese so...
iguais = equal
diferentes = different

Regards,
Igor Escobar
*Software Engineer
*
+ http://blog.igorescobar.com
+ http://www.igorescobar.com
+ @igorescobar http://www.twitter.com/igorescobar


The person who posted this (andersonfraga) has set up four string comparison 
tests.

It was commented by augustohp who said:-


float_a.php
Existe uma configuração no php.ini da precisão de números de ponto flutuante. 
Acima desse número, todos são arredondados.

There is a configuration setting in php.ini that determines the precision of 
floating point numbers. A number greater than that setting causes rounding.

float_b.php
Com a bcmath você não está comparando tipos especializados 
de dados, mas sim dados binários. É mais demorado, mas é extremamente 
preciso, sempre.

With bcmath you are doing a binary comparison. It is slower but precise, always.

string_a.php
Quando você usa == você não compara os tipos, e não força o 
interpretador a respeitar o tipo de dado fornecido. O que acontece 
então!? O PHP converte o tipo para o tipo de dado mais apropriado em uma 
condição: boolean, inteiro, etc ...
Se você converter para inteiro, vai ver que os números são iguais.

When you use the == operator you don't compare data types and don't force the 
interpreter to respect the data type supplied. What happens then? PHP converts 
the type to the most appropriate data type and returns a boolean. (I assume he 
means casting. I always thought that you had to cast the variables implicitly 
in order to use ==.)
I think he is saying in the next sentence that if you cast them to integers, 
you'll see that the numbers are equal. Doesn't make any sense to me, but 
then, I'm no expert.

string_b.php
Aqui sim você compara strings, garante que elas não sofram cast para outro tipo 
de dado. Você pode atingir isso usando === também, sem essa função de 
comparação de strings.

Here you compare strings, and guarantee that they don't suffer casting to 
another data type. You can achieve the same thing by using the === operator 
also, without (using) this string comparison function.


Hope this helps.

Cheers,
Robert

[PHP] Bug?

2011-09-15 Thread Igor Escobar
Anyone can explain this?

https://gist.github.com/1220404

Part of the code are in portuguese so...
iguais = equal
diferentes = different

Regards,
Igor Escobar
*Software Engineer
*
+ http://blog.igorescobar.com
+ http://www.igorescobar.com
+ @igorescobar http://www.twitter.com/igorescobar


Re: [PHP] Bug?

2011-09-15 Thread Daniel Brown
On Thu, Sep 15, 2011 at 17:07, Igor Escobar titiolin...@gmail.com wrote:
 Anyone can explain this?

 https://gist.github.com/1220404

 Part of the code are in portuguese so...
 iguais = equal
 diferentes = different

About this part are you confused?

-- 
/Daniel P. Brown
Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] Bug?

2011-09-15 Thread Igor Escobar
I'm confused about the output of the code... very disturbed. But
@*augustohphttps://gist.github.com/augustohp
*  already respond the question on the gist thread (in portuguese) and
explained why those results.


Regards,
Igor Escobar
*Software Engineer
*
+ http://blog.igorescobar.com
+ http://www.igorescobar.com
+ @igorescobar http://www.twitter.com/igorescobar





On Thu, Sep 15, 2011 at 6:17 PM, Daniel Brown danbr...@php.net wrote:

 On Thu, Sep 15, 2011 at 17:07, Igor Escobar titiolin...@gmail.com wrote:
  Anyone can explain this?
 
  https://gist.github.com/1220404
 
  Part of the code are in portuguese so...
  iguais = equal
  diferentes = different

 About this part are you confused?

 --
 /Daniel P. Brown
 Network Infrastructure Manager
 http://www.php.net/



Fwd: [PHP] Bug?

2011-09-15 Thread tamouse mailing lists
Hit reply instead of reply-all /o\


-- Forwarded message --
From: tamouse mailing lists tamouse.li...@gmail.com
Date: Thu, Sep 15, 2011 at 4:39 PM
Subject: Re: [PHP] Bug?
To: Igor Escobar titiolin...@gmail.com


On Thu, Sep 15, 2011 at 4:07 PM, Igor Escobar titiolin...@gmail.com wrote:
 Anyone can explain this?

 https://gist.github.com/1220404

For the floats, http://us2.php.net/operators.comparison makes it
pretty clear (and this has been a well-known thing about floats as far
back as Uni for me, in 1979).

The string thing is noted in PHP as far back as 2004:

http://us2.php.net/manual/en/language.types.string.php#41986

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



Re: Fwd: [PHP] Bug?

2011-09-15 Thread Tim Streater
On 15 Sep 2011 at 22:43, tamouse mailing lists tamouse.li...@gmail.com wrote: 

 For the floats, http://us2.php.net/operators.comparison makes it
 pretty clear (and this has been a well-known thing about floats as far
 back as Uni for me, in 1979).

The fact that floating point hardware has limited precision has been known ever 
since the first such hardware in the mid-1950's, in fact.

--
Cheers  --  Tim

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

Re: [PHP] Bug #51739 tricky string to float conversion

2011-09-01 Thread Simon J Welsh
On 1/09/2011, at 9:53 AM, magic-...@damage.devloop.de wrote:

 Am Mittwoch, 31. August 2011, 20:48:37 schrieb Shawn McKenzie:
 On 08/31/2011 09:03 AM, magic-...@damage.devloop.de wrote:
 Hi,
 I have opend Bug #51739 in 2010. It was closed as bogus before my last
 question was answered. It would be fine to know what you think about
 that bug.
 In short:
 var_dump((float)8315e839da08e2a7afe6dd12ec58245d);
 results in float(INF)
 This is because 8315 is treated as base and
 e839da08e2a7afe6dd12ec58245d is treated as an exponent. My hint that
 e839da08e2a7afe6dd12ec58245d is not a valid exponent was not answered.
 What do you think about?
 cheers
 Daniel
 
 The cast to float is truncating the invalid characters and since your
 string contains a float that is INF (8315e839) before the truncation at
 the d, then it returns INF.  Makes perfect sense.
 
 This is what drives me crazy.
 
 If I use a string in PHP I don't want PHP to cut this string. Either it uses 
 this string as it is or it gives me an error/warning/false (what ever...). 
 But 
 silently(!!!) using a small piece of a string is not understandable.
 
 cheers
 Daniel

The manual clearly states this is how a string is converted into a number: 
http://php.net/manual/en/language.types.string.php#language.types.string.conversion

The value is given by the initial portion of the string. If the string starts 
with valid numeric data, this will be the value used. Otherwise, the value will 
be 0 (zero). Valid numeric data is an optional sign, followed by one or more 
digits (optionally containing a decimal point), followed by an optional 
exponent. The exponent is an 'e' or 'E' followed by one or more digits.

If you don't want the string turned into a number using the documented method, 
don't use it as one.
---
Simon Welsh
Admin of http://simon.geek.nz/


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



Re: [PHP] Bug #51739 tricky string to float conversion

2011-09-01 Thread magic-php
Simon J Welsh writes: 

On 1/09/2011, at 9:53 AM, magic-...@damage.devloop.de wrote: 


Am Mittwoch, 31. August 2011, 20:48:37 schrieb Shawn McKenzie:

On 08/31/2011 09:03 AM, magic-...@damage.devloop.de wrote:

var_dump((float)8315e839da08e2a7afe6dd12ec58245d);
results in float(INF)


The cast to float is truncating the invalid characters and since your
string contains a float that is INF (8315e839) before the truncation at
the d, then it returns INF.  Makes perfect sense.


If I use a string in PHP I don't want PHP to cut this string. Either it uses 
this string as it is or it gives me an error/warning/false (what ever...). But 
silently(!!!) using a small piece of a string is not understandable.


The manual clearly states this is how a string is converted into a number: http://php.net/manual/en/language.types.string.php#language.types.string.conversion 

The value is given by the initial portion of the string. If the string starts with valid numeric data, this will be the value used. Otherwise, the value will be 0 (zero). Valid numeric data is an optional sign, followed by one or more digits (optionally containing a decimal point), followed by an optional exponent. The exponent is an 'e' or 'E' followed by one or more digits. 


If you don't want the string turned into a number using the documented method, 
don't use it as one.


Ok, then let's discuss the documented behavior ;-) 

Do you (not the document) really like this behavior? I mean if I am the 
only one wondering about that behavior it is ok for me. I just want to help 
PHP. 


cheers
Daniel

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



Re: [PHP] Bug #51739 tricky string to float conversion

2011-09-01 Thread Florian Lemaitre

Le 01/09/2011 10:43, magic-...@damage.devloop.de a écrit :

Simon J Welsh writes:

On 1/09/2011, at 9:53 AM, magic-...@damage.devloop.de wrote:

Am Mittwoch, 31. August 2011, 20:48:37 schrieb Shawn McKenzie:

On 08/31/2011 09:03 AM, magic-...@damage.devloop.de wrote:

var_dump((float)8315e839da08e2a7afe6dd12ec58245d);
results in float(INF)


The cast to float is truncating the invalid characters and since your
string contains a float that is INF (8315e839) before the 
truncation at

the d, then it returns INF.  Makes perfect sense.


If I use a string in PHP I don't want PHP to cut this string. Either 
it uses this string as it is or it gives me an error/warning/false 
(what ever...). But silently(!!!) using a small piece of a string is 
not understandable.


The manual clearly states this is how a string is converted into a 
number: 
http://php.net/manual/en/language.types.string.php#language.types.string.conversion 

The value is given by the initial portion of the string. If the 
string starts with valid numeric data, this will be the value used. 
Otherwise, the value will be 0 (zero). Valid numeric data is an 
optional sign, followed by one or more digits (optionally containing 
a decimal point), followed by an optional exponent. The exponent is 
an 'e' or 'E' followed by one or more digits.
If you don't want the string turned into a number using the 
documented method, don't use it as one.


Ok, then let's discuss the documented behavior ;-)
Do you (not the document) really like this behavior? I mean if I am 
the only one wondering about that behavior it is ok for me. I just 
want to help PHP.

cheers
Daniel


No professional programmer would like this kind of behavior.
But PHP want to be accessible for newbies so we have to deal with that.
Hope this will be fixed in the next generation...



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



Re: [PHP] Bug #51739 tricky string to float conversion

2011-09-01 Thread Simon J Welsh
On 1/09/2011, at 8:43 PM, magic-...@damage.devloop.de wrote:

 Simon J Welsh writes: 
 On 1/09/2011, at 9:53 AM, magic-...@damage.devloop.de wrote: 
 Am Mittwoch, 31. August 2011, 20:48:37 schrieb Shawn McKenzie:
 On 08/31/2011 09:03 AM, magic-...@damage.devloop.de wrote:
 var_dump((float)8315e839da08e2a7afe6dd12ec58245d);
 results in float(INF)
 The cast to float is truncating the invalid characters and since your
 string contains a float that is INF (8315e839) before the truncation at
 the d, then it returns INF.  Makes perfect sense.
 If I use a string in PHP I don't want PHP to cut this string. Either it 
 uses this string as it is or it gives me an error/warning/false (what 
 ever...). But silently(!!!) using a small piece of a string is not 
 understandable.
 The manual clearly states this is how a string is converted into a number: 
 http://php.net/manual/en/language.types.string.php#language.types.string.conversion
  The value is given by the initial portion of the string. If the string 
 starts with valid numeric data, this will be the value used. Otherwise, the 
 value will be 0 (zero). Valid numeric data is an optional sign, followed by 
 one or more digits (optionally containing a decimal point), followed by an 
 optional exponent. The exponent is an 'e' or 'E' followed by one or more 
 digits. If you don't want the string turned into a number using the 
 documented method, don't use it as one.
 
 Ok, then let's discuss the documented behavior ;-) 
 Do you (not the document) really like this behavior? I mean if I am the only 
 one wondering about that behavior it is ok for me. I just want to help PHP. 
 cheers
 Daniel

Yes, I think the way it works is correct.

It follows similar conversions when changing from a data type that allows more 
data to one that allows less. Similar things happen when converting from a 
floating point to integral value.

It also directly correlates to the C functions for doing the same thing (atof, 
strtod, the like).
---
Simon Welsh
Admin of http://simon.geek.nz/


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



[PHP] Bug #51739 tricky string to float conversion

2011-08-31 Thread magic-php

Hi,
I have opend Bug #51739 in 2010. It was closed as bogus before my last 
question was answered. It would be fine to know what you think about that 
bug. 


In short:
var_dump((float)8315e839da08e2a7afe6dd12ec58245d); 

results in float(INF) 

This is because 8315 is treated as base and 
e839da08e2a7afe6dd12ec58245d is treated as an exponent. My hint that 
e839da08e2a7afe6dd12ec58245d is not a valid exponent was not answered. 

What do you think about? 


cheers
Daniel

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



[PHP] A php bug or?..

2011-08-08 Thread Andre Polykanine
Hi everyone,

As we all know, count() returns 1 if the variable 
is not an array.
Question is: why in the world does it this? If a variable is *notA* an array, 
it contains *zero* array elements.
You can answer: but no, man, you can say
$x=world;
$y=$x{3}; // $y=l

so the variable is treated or can be treated as an array.
Well. If strings are treated like arrays, why count($x) doesn't return 5 
instead of 1?
Just asking.

-- 
With best regards from Ukraine,
Andre
Skype: Francophile
Blog: http://oire.org/menelion
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion


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



Re: [PHP] A php bug or?..

2011-08-08 Thread Simon J Welsh
On 9/08/2011, at 8:20 AM, Andre Polykanine wrote:

 Hi everyone,
 
As we all know, count() returns 1 if the variable 
 is not an array.
 Question is: why in the world does it this? If a variable is *notA* an array, 
 it contains *zero* array elements.
 You can answer: but no, man, you can say
 $x=world;
 $y=$x{3}; // $y=l
 
 so the variable is treated or can be treated as an array.
 Well. If strings are treated like arrays, why count($x) doesn't return 5 
 instead of 1?
 Just asking.
 
 -- 
 With best regards from Ukraine,
 Andre

I'm assuming it has to do with the value, if not an array or object, being cast 
as an array. Thus, non-false equivalent values get cast into an array of size 1:
?php
var_dump((array)1);
var_dump((array)null);

// Output
array(1) {
  [0]=
  int(1)
}
array(0) {
}

---
Simon Welsh
Admin of http://simon.geek.nz/


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



Re: [PHP] A php bug or?..

2011-08-08 Thread Daniel P. Brown
On Mon, Aug 8, 2011 at 16:20, Andre Polykanine an...@oire.org wrote:
 Hi everyone,

                            As we all know, count() returns 1 if the variable 
 is not an array.
 Question is: why in the world does it this? If a variable is *notA* an array, 
 it contains *zero* array elements.
 You can answer: but no, man, you can say
 $x=world;
 $y=$x{3}; // $y=l

 so the variable is treated or can be treated as an array.
 Well. If strings are treated like arrays, why count($x) doesn't return 5 
 instead of 1?
 Just asking.

Using count() will return the number of items passed in the first
parameter.  If it's an array, each element is an item.  If it's a
string, the string is an item.  If it's an object, logically, the
items depend on what is contained in the object.  However, at no time
does it return the number of characters within a string --- instead,
as you likely know, you'd use strlen().

-- 
/Daniel P. Brown
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

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



Re: [PHP] A php bug or?..

2011-08-08 Thread Andre Polykanine

Hello Daniel,

  
DPB does it return the number of characters within a string --- instead,
DPB as you likely know, you'd use strlen().

  For sure. But I'm asking: why it doesn't return 0 if it is not an array? 
Logically: no array - no items!
-- 
With best regards from Ukraine,
Andre
Skype: Francophile
My blog: http://oire.org/menelion (mostly in Russian)
Twitter: http://twitter.com/m_elensule
Facebook: http://facebook.com/menelion


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



Re: [PHP] A php bug or?..

2011-08-08 Thread Stuart Dallas
On 8 Aug 2011, at 21:41, Andre Polykanine wrote:

 DPB does it return the number of characters within a string --- instead,
 DPB as you likely know, you'd use strlen().
 
  For sure. But I'm asking: why it doesn't return 0 if it is not an array? 
 Logically: no array - no items!


The manual explains what the function does - you may want to check it out cos 
it does the same for all the other functions too.

Returns the number of elements in var. If var is not an array or an object 
with implemented Countable interface, 1 will be returned. There is one 
exception, if var is NULL, 0 will be returned.

IOW, if you pass it a variable, that has one element, so it returns 1. An array 
may have 0 to many elements, and null, logically, has none. Rocket science this 
ain't!

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] A php bug or?..

2011-08-08 Thread Daniel P. Brown
On Mon, Aug 8, 2011 at 16:41, Andre Polykanine an...@oire.org wrote:

      For sure. But I'm asking: why it doesn't return 0 if it is not an array? 
 Logically: no array - no items!

No, actually, if it's a string, it's a single item --- thus, 1.
The documentation should probably reflect that as well.  It wasn't
always this way before, though --- in older version of PHP5 it
returned 0, and in all versions of PHP4 it did as well.

Also, keep in mind that a blank string still constitutes a string
and will return 1, but null or nonexistent variables will still return
0.

-- 
/Daniel P. Brown
Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

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



[PHP] Bug #52782: DOMDocument subclass forgotten using -ownerDocument after closure

2010-10-05 Thread Jan Moesen
(I filed bug #52782 about a month ago, but have not received any reply. 
I am posting here to try and get some feedback on it.)


We have custom XML document and element classes that extend the original 
DOMDocument and DOMElement classes for convenience. There is a class 
that uses an instance of XmlElement obtained via a callback specified at 
construction time. That XmlElement works fine and stays that way. 
However, when we get its ownerDocument outside of the closure, the 
result is not an XmlDocument but a DOMDocument. I cannot see a single 
reason why.


I tried several options, and it only seems to happen with that closure. 
I have checked versions 5.3.1, 5.3.2, 5.3.3 and now the latest 5.3.4 
snapshot compiled with './configure  make'.


More details and a test case: http://bugs.php.net/bug.php?id=52782

Jan

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



[PHP] bug in mkdir?

2010-06-10 Thread Mike Wright

Hi all,

Using 5.2.9

I'm trying to create a directory but it is being created with incorrect 
permissions.  I'm following the online manual.


This is the command being used:

mkdir('/srv/www/domain/data/R1276190214358/thumbs', 0770, true);

This is what is created:

drwxr-x--- 2 apache apache 4096 2010-06-10 10:33 R1276190214358

Isn't that supposed to be 0770 instead of 0750?  Either the manual is 
wrong, the command is broken, or I'm screwing it up (most likely).


Thanks for any help,
Mike Wright

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



Re: [PHP] bug in mkdir?

2010-06-10 Thread Ashley Sheridan
On Thu, 2010-06-10 at 11:32 -0700, Mike Wright wrote:

 Hi all,
 
 Using 5.2.9
 
 I'm trying to create a directory but it is being created with incorrect 
 permissions.  I'm following the online manual.
 
 This is the command being used:
 
  mkdir('/srv/www/domain/data/R1276190214358/thumbs', 0770, true);
 
 This is what is created:
 
  drwxr-x--- 2 apache apache 4096 2010-06-10 10:33 R1276190214358
 
 Isn't that supposed to be 0770 instead of 0750?  Either the manual is 
 wrong, the command is broken, or I'm screwing it up (most likely).
 
 Thanks for any help,
 Mike Wright
 

Did the R1276190214358 directory already exist? If so, it will retain
the permissions it had, and only the thumbs sub-directory within it will
have the new permissions.

Also, is this on a shared hosting server? It could be that a security
restriction in-place is not allowing the permissions to be configured as
the directory is written, and you may have to manually update them with
the chmod() function.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] bug in mkdir? [SOLVED]

2010-06-10 Thread Mike Wright

Ashley Sheridan wrote:

On Thu, 2010-06-10 at 11:32 -0700, Mike Wright wrote:


Hi all,

Using 5.2.9

I'm trying to create a directory but it is being created with incorrect 
permissions.  I'm following the online manual.


This is the command being used:

 mkdir('/srv/www/domain/data/R1276190214358/thumbs', 0770, true);

This is what is created:

 drwxr-x--- 2 apache apache 4096 2010-06-10 10:33 R1276190214358

Isn't that supposed to be 0770 instead of 0750?  Either the manual is 
wrong, the command is broken, or I'm screwing it up (most likely).


Thanks for any help,
Mike Wright





Hi, Ash.  Thanks for the help.


Did the R1276190214358 directory already exist?


No.

 If so, it will retain

the permissions it had, and only the thumbs sub-directory within it will
have the new permissions.

Also, is this on a shared hosting server? It could be that a security
restriction in-place is not allowing the permissions to be configured as
the directory is written, and you may have to manually update them with
the chmod() function.


It's under my control.

Solution: run umask(000) first.  (of the 3 choices above it turned out 
to be #3 ;(



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



Re: [PHP] bug tracking system

2010-03-29 Thread Anshul Agrawal
There is something new based on Trac but written in PHP.

mtrack (http://bitbucket.org/wez/mtrack/wiki/Home)

It is written by one of the PHP Core Developers (Wez Furlong). May be you
want to try it out.

Best,
Anshul


On Sun, Mar 28, 2010 at 10:36 PM, Nathan Rixham nrix...@gmail.com wrote:

 shiplu wrote:
  I want to add with Andre.
  I am looking for a free hosted bug tracking solution. I can not afford
  to host it in my web server.
  So is there any free one??
  It should not be public. Only me and my clients will be able to see it.
 
  Thanks
 

 yes, for all cases, commercial or not; self hosted or remote; indefero
 [1] is a fantastic quick to use solution:

 [1] http://www.indefero.net/

 Many Regards,

 Nathan

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




Re: [PHP] bug tracking system

2010-03-29 Thread Jan G.B.
2010/3/29 Anshul Agrawal drinknder...@gmail.com

 There is something new based on Trac but written in PHP.

 mtrack (http://bitbucket.org/wez/mtrack/wiki/Home)

 It is written by one of the PHP Core Developers (Wez Furlong). May be you
 want to try it out.

 And there's something quite new that's aimed to be like trac : JotBug
http://code.google.com/p/jotbug/


Regards


Re: [PHP] bug tracking system

2010-03-29 Thread Anshul Agrawal
On Mon, Mar 29, 2010 at 5:30 PM, Jan G.B. ro0ot.w...@googlemail.com wrote:


 2010/3/29 Anshul Agrawal drinknder...@gmail.com

 There is something new based on Trac but written in PHP.

 mtrack (http://bitbucket.org/wez/mtrack/wiki/Home)

 It is written by one of the PHP Core Developers (Wez Furlong). May be you
 want to try it out.

 And there's something quite new that's aimed to be like trac : JotBug
 http://code.google.com/p/jotbug/


 Regards


I kept wondering for long time why PHP community doesn't have something at
least as cool as Trac. Times are changing :)

-- 
Anshul


[PHP] bug tracking system

2010-03-28 Thread Andre Polykanine
Hello everyone,

Can you recommend a bug tracking system to be installed on the site?
Requirements: written in PHP (or maybe Perl); tickets system; e-mail
notifications.
-- 
With best regards from Ukraine,
Andre
Http://oire.org/ - The Fantasy blogs of Oire
Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: http://twitter.com/m_elensule


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



Re: [PHP] bug tracking system

2010-03-28 Thread Ashley Sheridan
On Sun, 2010-03-28 at 16:28 +0300, Andre Polykanine wrote:

 Hello everyone,
 
 Can you recommend a bug tracking system to be installed on the site?
 Requirements: written in PHP (or maybe Perl); tickets system; e-mail
 notifications.
 -- 
 With best regards from Ukraine,
 Andre
 Http://oire.org/ - The Fantasy blogs of Oire
 Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
 jabber.org
 Yahoo! messenger: andre.polykanine; ICQ: 191749952
 Twitter: http://twitter.com/m_elensule
 
 


I think your best option is Mantis. It's written in PHP, does all that
you've asked, and it's pretty easy to use really.

Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] bug tracking system

2010-03-28 Thread Nilesh Govindarajan

On 03/28/2010 06:58 PM, Andre Polykanine wrote:

Hello everyone,

Can you recommend a bug tracking system to be installed on the site?
Requirements: written in PHP (or maybe Perl); tickets system; e-mail
notifications.


http://www.google.co.in/search?aq=0oq=php+bugsourceid=chromeie=UTF-8q=php+bug+tracker

--
Nilesh Govindarajan
Site  Server Administrator
www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !

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



Re: [PHP] bug tracking system

2010-03-28 Thread Nathan Rixham
Ashley Sheridan wrote:
 On Sun, 2010-03-28 at 16:28 +0300, Andre Polykanine wrote:

 Can you recommend a bug tracking system to be installed on the site?
 Requirements: written in PHP (or maybe Perl); tickets system; e-mail
 notifications.
 
 
 I think your best option is Mantis. It's written in PHP, does all that
 you've asked, and it's pretty easy to use really.
 

agreed, unless IDE integration and familiarity is the name of the game,
in which case the usual suspects of trac, jira and bugzilla are worth
considering.

regards!

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



Re: [PHP] bug tracking system

2010-03-28 Thread ebhakt
Use drupal with the bug tracking system
http://drupal.org/project/project_issue

On Sun, Mar 28, 2010 at 6:58 PM, Andre Polykanine an...@oire.org wrote:

 Hello everyone,

 Can you recommend a bug tracking system to be installed on the site?
 Requirements: written in PHP (or maybe Perl); tickets system; e-mail
 notifications.
 --
 With best regards from Ukraine,
 Andre
 Http://oire.org/ - The Fantasy blogs of Oire
 Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @
 jabber.org
 Yahoo! messenger: andre.polykanine; ICQ: 191749952
 Twitter: http://twitter.com/m_elensule


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




-- 
Bhaskar Tiwari
GTSE Generalist
Directory Services
Microsoft


All we have to decide is what to do with the time that has been given to us


http://www.ebhakt.com/
http://fytclub.net/
http://ebhakt.info/


Re: [PHP] bug tracking system

2010-03-28 Thread Nilesh Govindarajan

On 03/28/2010 07:25 PM, ebhakt wrote:

Use drupal with the bug tracking system
http://drupal.org/project/project_issue
http://drupal.org/project/project_issue

On Sun, Mar 28, 2010 at 7:22 PM, Nilesh Govindarajan li...@itech7.com
mailto:li...@itech7.com wrote:

On 03/28/2010 06:58 PM, Andre Polykanine wrote:

Hello everyone,

Can you recommend a bug tracking system to be installed on the site?
Requirements: written in PHP (or maybe Perl); tickets system; e-mail
notifications.



http://www.google.co.in/search?aq=0oq=php+bugsourceid=chromeie=UTF-8q=php+bug+tracker

http://www.google.co.in/search?aq=0oq=php+bugsourceid=chromeie=UTF-8q=php+bug+tracker

--
Nilesh Govindarajan
Site  Server Administrator
www.itech7.com http://www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !


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




--
Bhaskar Tiwari
GTSE Generalist
Directory Services
Microsoft


All we have to decide is what to do with the time that has been given to us


http://www.ebhakt.com/
http://fytclub.net/
http://ebhakt.info/




Hey, I wasn't the one who put up the question.

--
Nilesh Govindarajan
Site  Server Administrator
www.itech7.com
मेरा भारत महान !
मम भारत: महत्तम भवतु !

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



Re: [PHP] bug tracking system

2010-03-28 Thread shiplu
I want to add with Andre.
I am looking for a free hosted bug tracking solution. I can not afford
to host it in my web server.
So is there any free one??
It should not be public. Only me and my clients will be able to see it.

Thanks

-- 
Shiplu Mokaddim
My talks, http://talk.cmyweb.net
Follow me, http://twitter.com/shiplu
SUST Programmers, http://groups.google.com/group/p2psust
Innovation distinguishes bet ... ... (ask Steve Jobs the rest)

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



Re: [PHP] bug tracking system

2010-03-28 Thread Nathan Rixham
shiplu wrote:
 I want to add with Andre.
 I am looking for a free hosted bug tracking solution. I can not afford
 to host it in my web server.
 So is there any free one??
 It should not be public. Only me and my clients will be able to see it.
 
 Thanks
 

yes, for all cases, commercial or not; self hosted or remote; indefero
[1] is a fantastic quick to use solution:

[1] http://www.indefero.net/

Many Regards,

Nathan

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



[PHP] Bug in php-cgi.exe

2009-10-13 Thread loki

Hello,

i thing i found a bug in PHP-cgi.exe

I use Php-cgi as fastCgi

php-cgi.exe -b host:port

i set in environement variables this :

PHP_FCGI_CHILDREN=8
PHP_FCGI_MAX_REQUESTS=1000

in the task manager i see only one  Php-cgi.exe
process (when normaly i must see 9 process no?)
and after i send more than 1000 request the
php-cgi.exe process died ! and i must manually
restart it!


Thanks you by advance for you help

--
stephane

Http://www.arkadia.com/fra/
Http://www.arkadia.com/usa/
Http://www.arkadia.com/rus/

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



Re: [PHP] bug or expected, mbstring.func_overload not changeable by .htaccess 5.2.8/5.2.9

2009-04-23 Thread Thodoris



Hello,


Besides the .htaccess which might be an apache configuration problem if
you use ini_set(mbstring.func_overload,2) in a script of this
directory does it work?

no, also the ini_set does not work for this Directive.


Sorry for the late reply.

The ini_set is meant to be used inside a php script not in an .htaccess 
file.

So perhaps you could test this in a script specific manner.





In addition to this heck your apache configuration to see if you allow
.htaccess to be parsed.


apache and .htaccess are ok
i added a scond line which changes mbstring.encoding_translation from 
off to on without problems:


Directive Local Value Master Value
mbstring.encoding_translation On Off
mbstring.func_overload 0 0

.htaccess:

php_value mbstring.func_overload 2
php_flag mbstring.encoding_translation On


IMHO this is not a good practice using .htaccess to alter php's behavior.
Perhaps you should consider ini_set after all.



Can you confirm or rebut this behavior?
Should we go to internals list?
Thanks,
Andre


Unfortunately I can confirm that.

This is a list with all the initial values you are allowed to change:

http://www.php.net/manual/en/ini.list.php

This is a script that shows all the mbstring extension values in an array:

?php
print pre;
print_r(ini_get_all('mbstring'));
?

This array contains the default,local values and access level for each one.

Note that according to the manual:

http://www.php.net/ini_get_all

The access levels for every value are:|

Constant   Value  Meaning
PHP_INI_USER  1  Entry can be set in user scripts
PHP_INI_PERDIR2  Entry can be set in php.ini, .htaccess or 
httpd.conf 
PHP_INI_SYSTEM4  Entry can be set in php.ini or httpd.conf 
PHP_INI_ALL   7  Entry can be set anywhere




|Although in the ini list the mbstring is supposed to have access level 
2 I've noticed that I have access level 4 for mbstring.func_overload.
Perhaps *this is the problem*. You have access level 4 so that is why 
you can't change the value using .htaccess.


I don't know if this is an expected behavior though. Can anyone else 
confirm this??


--
Thodoris



Re: [PHP] bug or expected, mbstring.func_overload not changeable by .htaccess 5.2.8/5.2.9

2009-04-23 Thread Andre Hübner

Hello,

Sorry for the late reply.

no problem.
The ini_set is meant to be used inside a php script not in an .htaccess 
file.

So perhaps you could test this in a script specific manner.

i know;) i do php/apache for some years...

i found out the problem in meanwhile.
http://bugs.php.net/bug.php?id=47187edit=1
Its not allowed anymore, just not documented.
formerly bug was fixed by deactivating ;) thats a pitty cause the patch for 
3rd party patch for ~5.2.6 for mentioned bug worked really good. :(


Thanks,
Andre 



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



Re: [PHP] bug or expected, mbstring.func_overload not changeable by .htaccess 5.2.8/5.2.9

2009-04-16 Thread Andre Hübner

Hello,


Besides the .htaccess which might be an apache configuration problem if
you use ini_set(mbstring.func_overload,2) in a script of this
directory does it work?

no, also the ini_set does not work for this Directive.


In addition to this heck your apache configuration to see if you allow
.htaccess to be parsed.


apache and .htaccess are ok
i added a scond line which changes mbstring.encoding_translation from off to 
on without problems:


Directive Local Value Master Value
mbstring.encoding_translation On Off
mbstring.func_overload 0 0

.htaccess:

php_value mbstring.func_overload 2
php_flag mbstring.encoding_translation On

Can you confirm or rebut this behavior?
Should we go to internals list?
Thanks,
Andre 



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



Re: [PHP] bug or expected, mbstring.func_overload not changeable by .htaccess 5.2.8/5.2.9

2009-04-15 Thread Thodoris



Hello,

following in my .htaccess works with php 5.2.6 (mod_php)

php_value mbstring.func_overload 2

Seems that since (5.2.7?) 5.2.8/5.2.9 this value is not any more 
accepted by php in .htaccess.
mbstring.func_overload should be changeable by PHP_INI_PERDIR which 
includes .htaccess
Other values are changeable by .htaccess so it should not be a general 
problem on my side.

Please someone could check this?

Thanks,
Andre




Besides the .htaccess which might be an apache configuration problem if 
you use ini_set(mbstring.func_overload,2) in a script of this 
directory does it work?


In addition to this heck your apache configuration to see if you allow 
.htaccess to be parsed.


--
Thodoris


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



[PHP] bug or expected, mbstring.func_overload not changeable by .htaccess 5.2.8/5.2.9

2009-04-14 Thread Andre Hübner

Hello,

following in my .htaccess works with php 5.2.6 (mod_php)

php_value mbstring.func_overload 2

Seems that since (5.2.7?) 5.2.8/5.2.9 this value is not any more accepted by 
php in .htaccess.
mbstring.func_overload should be changeable by PHP_INI_PERDIR which includes 
.htaccess
Other values are changeable by .htaccess so it should not be a general 
problem on my side.

Please someone could check this?

Thanks,
Andre


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



[PHP] php bug from 2003 still alive?!

2009-03-30 Thread Merlin Morgenstern

Hello,

I am experiencing problems with utf-8 and php. There seems to be a 
problem with BOM.


Some postings say that I have to compile php with 
--enable-zend-multibyte. HOwever those postings are very old (2003!).

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

Is this still necessary with the newest php build? If yes, do you 
believe I will run into trouble on sites that are saved in ansi?


Thank you for any hint.

Merlin

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



[PHP] Re: php bug from 2003 still alive?! - UTF8 BOM

2009-03-30 Thread Merlin Morgenstern

Hello everybody,

has anybody an idea on how to fix this? Is it really necessary to 
recomplile for utf-8 BOM support?


Regards, Merlin

Merlin Morgenstern wrote:

Hello,

I am experiencing problems with utf-8 and php. There seems to be a 
problem with BOM.


Some postings say that I have to compile php with 
--enable-zend-multibyte. HOwever those postings are very old (2003!).

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

Is this still necessary with the newest php build? If yes, do you 
believe I will run into trouble on sites that are saved in ansi?


Thank you for any hint.

Merlin


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



Re: [PHP] php bug from 2003 still alive?!

2009-03-30 Thread Thiago H. Pojda
On Mon, Mar 30, 2009 at 12:42 PM, Merlin Morgenstern
merli...@fastmail.fmwrote:

 Some postings say that I have to compile php with --enable-zend-multibyte.
 HOwever those postings are very old (2003!).
 http://bugs.php.net/bug.php?id=22108


Did you see what Derick said abut this in the last comment?
*
[22 Aug 2005 6:35pm UTC] der...@php.net*
This will come with Unicode support in PHP 6.0


 Is this still necessary with the newest php build?

Looks like it.


 If yes, do you believe I will run into trouble on sites that are saved in
 ansi?


I'm not sure, you should probably wait for someone else to reply :)

Regards,
Thiago Henrique Pojda
http://nerdnaweb.blogspot DOT com


Re: [PHP] php bug from 2003 still alive?!

2009-03-30 Thread Merlin Morgenstern

Yes I was reading about this. However, try to do a search on this:
http://www.google.de/search?hl=deq=enable-zend-multibytebtnG=Google-Suchemeta=

Loads of postings that do not look that good. What are all the chinese 
sites do? It is strange that there is no official description on php.net 
regarding this support.


Thiago H. Pojda wrote:

On Mon, Mar 30, 2009 at 12:42 PM, Merlin Morgenstern
merli...@fastmail.fmwrote:


Some postings say that I have to compile php with --enable-zend-multibyte.
HOwever those postings are very old (2003!).
http://bugs.php.net/bug.php?id=22108



Did you see what Derick said abut this in the last comment?
*
[22 Aug 2005 6:35pm UTC] der...@php.net*
This will come with Unicode support in PHP 6.0



Is this still necessary with the newest php build?


Looks like it.



If yes, do you believe I will run into trouble on sites that are saved in
ansi?



I'm not sure, you should probably wait for someone else to reply :)

Regards,
Thiago Henrique Pojda
http://nerdnaweb.blogspot DOT com



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



[PHP] UTF 8 support - enable-zend-multibyte ( was Re: [PHP] php bug from 2003 still alive?! - )

2009-03-30 Thread Merlin Morgenstern

HI there,

I now compiled php with zend multibyte. The trouble with the extra 
characters is now gone, but all special characters are now replaced with 
a questionmark! The document type shows utf-8, but somehow php seems not 
to pars the content OK.


Does nobody have the same problem?

Regards, Merlin

Merlin Morgenstern wrote:

Yes I was reading about this. However, try to do a search on this:
http://www.google.de/search?hl=deq=enable-zend-multibytebtnG=Google-Suchemeta= 



Loads of postings that do not look that good. What are all the chinese 
sites do? It is strange that there is no official description on php.net 
regarding this support.


Thiago H. Pojda wrote:

On Mon, Mar 30, 2009 at 12:42 PM, Merlin Morgenstern
merli...@fastmail.fmwrote:

Some postings say that I have to compile php with 
--enable-zend-multibyte.

HOwever those postings are very old (2003!).
http://bugs.php.net/bug.php?id=22108



Did you see what Derick said abut this in the last comment?
*
[22 Aug 2005 6:35pm UTC] der...@php.net*
This will come with Unicode support in PHP 6.0



Is this still necessary with the newest php build?


Looks like it.


If yes, do you believe I will run into trouble on sites that are 
saved in

ansi?



I'm not sure, you should probably wait for someone else to reply :)

Regards,
Thiago Henrique Pojda
http://nerdnaweb.blogspot DOT com



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



Re: [PHP] UTF 8 support - enable-zend-multibyte ( was Re: [PHP] php bug from 2003 still alive?! - )

2009-03-30 Thread haliphax
On Mon, Mar 30, 2009 at 12:34 PM, Merlin Morgenstern
merli...@fastmail.fm wrote:
 HI there,

 I now compiled php with zend multibyte. The trouble with the extra
 characters is now gone, but all special characters are now replaced with a
 questionmark! The document type shows utf-8, but somehow php seems not to
 pars the content OK.

 Does nobody have the same problem?

 Regards, Merlin

Please stop top-posting.

Anyway, are you using a META tag codepage to tell the web browser what
to do with those special characters? I'm not certain a DOCTYPE is
going to handle everything.


-- 
// Todd

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



Re: [PHP] UTF 8 support - enable-zend-multibyte ( was Re: [PHP] php bug from 2003 still alive?! - )

2009-03-30 Thread Merlin Morgenstern

haliphax wrote:

On Mon, Mar 30, 2009 at 12:34 PM, Merlin Morgenstern
merli...@fastmail.fm wrote:

HI there,

I now compiled php with zend multibyte. The trouble with the extra
characters is now gone, but all special characters are now replaced with a
questionmark! The document type shows utf-8, but somehow php seems not to
pars the content OK.

Does nobody have the same problem?

Regards, Merlin


Please stop top-posting.

Anyway, are you using a META tag codepage to tell the web browser what
to do with those special characters? I'm not certain a DOCTYPE is
going to handle everything.




HI,

I am using a meta tag:
meta http-equiv=content-type content=text/html; charset=UTF-8

I have also configured apache:
AddDefaultCharset utf-8

Also php:
header('content-type: text/html; charset=utf-8');

Header:
HTTP/1.x 200 OK
Date: Mon, 30 Mar 2009 19:14:22 GMT
Server: Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8h PHP/5.2.9
X-Powered-By: PHP/5.2.9
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html; charset=utf-8

The chinese characters which come directly out of the database are shown 
corretly. The chinese chars that are saved in a text file show up as a 
question mark.





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



[PHP] Is it PHP Bug - memory leak ?

2008-12-27 Thread Pawel Rutkowski
Hello,

I try to run script below with PHP4 and it works.

--TEST--
Test session_encode() function : variation
--SKIPIF--
?php include('skipif.inc'); ?
--FILE--
?php

ob_start();
echo *** Testing session_encode() : variation ***\n;
var_dump(session_start());
$array = array(1,2,3);
$array[foo] = $array;
$array[blah] = $array;
$_SESSION[data] = $array;
var_dump(session_encode());
var_dump(session_destroy());
echo Done;
ob_end_flush();
?
--EXPECTF--
*** Testing session_encode() : variation ***
bool(true)
string(64) 
data|a:5:{i:0;i:1;i:1;i:2;i:2;i:3;s:3:foo;R:1;s:4:blah;R:1;}
bool(true)
Done


But in PHP5 x64 I have errors like:

/root/src/php-5.2.6/Zend/zend_hash.c(247) :  Freeing 0x0E76BC50 (75 bytes), 
script=ext/session/tests/session_encode_variation5.phpt
[Sat Dec 27 11:27:09 2008]  Script: 
'ext/session/tests/session_encode_variation5.phpt' 
/root/src/php-5.2.6/Zend/zend_vm_execute.h(3596) :  Freeing 0x0E76B990 (71 
bytes), script=ext/session/tests/session_encode_variation5.phpt
/root/src/php-5.2.6/Zend/zend_hash.c(388) : Actual location (location was 
relayed)

If I add:
$array[foo] = null;
$array[blah] = null;
in test code it works without errors. But is I always need to add 'null' ?

I'm asking because I have some site which genereating many errors like 
Actual location (location was relayed).

Thanks
Pawel R.



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



Re: [PHP] Is it PHP Bug - memory leak ?

2008-12-27 Thread Daniel Brown
Hi, Pawel;

On Sat, Dec 27, 2008 at 05:40, Pawel Rutkowski
rut...@freelance-worker.net wrote:
[snip!]

 But in PHP5 x64 I have errors like:

 /root/src/php-5.2.6/Zend/zend_hash.c(247) :  Freeing 0x0E76BC50 (75 bytes),
 script=ext/session/tests/session_encode_variation5.phpt
 [Sat Dec 27 11:27:09 2008]  Script:
 'ext/session/tests/session_encode_variation5.phpt'
 /root/src/php-5.2.6/Zend/zend_vm_execute.h(3596) :  Freeing 0x0E76B990 (71
 bytes), script=ext/session/tests/session_encode_variation5.phpt
 /root/src/php-5.2.6/Zend/zend_hash.c(388) : Actual location (location was
 relayed)

Please file a bug report on this with the reproduce cases at
http://bugs.php.net/.  There was a nearly identical case mentioned in
the Zend forums[1] as found by Google, but no resolution was reached
there.


KEY:
1: 
http://www.zend.com/forums/index.php?t=msggoto=19257S=e5a6d1ca82291c880a9d85093afe1ee7

-- 
/Daniel P. Brown
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Unadvertised dedicated server deals, too low to print - email me to find out!

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



Re: [PHP] Bug in array_key_exist?

2008-08-30 Thread Jochem Maas

Korgan schreef:

Korgan napsal(a):

Jim Lucas napsal(a):

Korgan wrote:

Hi,
I have a problem with array_key_exists in if statement.

I have a class with this function

class XXX {
private items = array();
...
...
...

public function addXXX($id, $count)
{
   $count = (int)$cout;


 Let me point at it 

Check your spelling

If error_reporting was set to E_ALL AND display_errors were turned 
on, you would see that you are using an undefined variable in your 
method called $cout, casting is as an int and assigning the resulting 
value (which would always be zero) to $count.


Sorry i didnt see it :). In the script is $count = (int)$count;



no point in anyone trying to help you then, because you don't post the code
you use, you post something else instead ... this is not [EMAIL PROTECTED]

btw there is practically no chance of a bug being in array_key_exists() and
you being the first to spot it, as a function it's used way too much to be
able to fly under the bug radar. jmho.



After add a item value is ok look at first B vardump which is on the end 
of the script.




No variable $count is mandatory so that is defined.
But its not main idea of my question...
Function add items correctly, but if go to next page, values in array 
change. Values are changed passing from one page to another one, why 
and where?



if (!array_key_exists($id, $this-items))
   $this-items[$id] = $count;
else
   $this-items[$id] += $count;
}

...
...

}

And I want to send instance of this class with SESSION.
If I add a item to the array, count is ok, but if i go to the next 
page count will change.



There is the code of index.php

 /** its loading classes ***/
 spl_autoload_register('loadClass');

 session_start();
 var_dump($_SESSION['XX']); /** A **/

 
 ...
 ...
 ...
 if ($_SESSION['XX'] instanceof XXX)
$x = $_SESSION['XX'];
  else
new...
  ..
  ..
  /** Do onzl this **/
  if 
$x-addXXX($id, $cnt);


  
  ...
  ...
  $_SESSION['XX'] = X;
  var_dump($_SESSION['XX']); /** B **/


There is a vardump if action addXXX exec:
   A:
object(Kosik)#1 (1) { [zbozi:private]=  array(0) { } }

   B:
object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  
int(1) } }


And than i will go to some page and vardums are:
   A:
object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  
int(4) } } 1 : 4


   B:
 object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  
int(4) } }


I am thinking that do both codes in if statement,
but $this-items[$id] += $count; exec after send page.



I am using PHP Version 5.2.6 and Smarty v.2.6.19

Thanks for help :)









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



Re: [PHP] Bug in array_key_exist?

2008-08-27 Thread Korgan

Korgan napsal(a):

Jim Lucas napsal(a):

Korgan wrote:

Hi,
I have a problem with array_key_exists in if statement.

I have a class with this function

class XXX {
private items = array();
...
...
...

public function addXXX($id, $count)
{
   $count = (int)$cout;


 Let me point at it 

Check your spelling

If error_reporting was set to E_ALL AND display_errors were turned on, 
you would see that you are using an undefined variable in your method 
called $cout, casting is as an int and assigning the resulting value 
(which would always be zero) to $count.


Sorry i didnt see it :). In the script is $count = (int)$count;

After add a item value is ok look at first B vardump which is on the end 
of the script.




No variable $count is mandatory so that is defined.
But its not main idea of my question...
Function add items correctly, but if go to next page, values in array 
change. Values are changed passing from one page to another one, why and 
where?



if (!array_key_exists($id, $this-items))
   $this-items[$id] = $count;
else
   $this-items[$id] += $count;
}

...
...

}

And I want to send instance of this class with SESSION.
If I add a item to the array, count is ok, but if i go to the next 
page count will change.



There is the code of index.php

 /** its loading classes ***/
 spl_autoload_register('loadClass');

 session_start();
 var_dump($_SESSION['XX']); /** A **/

 
 ...
 ...
 ...
 if ($_SESSION['XX'] instanceof XXX)
$x = $_SESSION['XX'];
  else
new...
  ..
  ..
  /** Do onzl this **/
  if 
$x-addXXX($id, $cnt);


  
  ...
  ...
  $_SESSION['XX'] = X;
  var_dump($_SESSION['XX']); /** B **/


There is a vardump if action addXXX exec:
   A:
object(Kosik)#1 (1) { [zbozi:private]=  array(0) { } }

   B:
object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  
int(1) } }


And than i will go to some page and vardums are:
   A:
object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  
int(4) } } 1 : 4


   B:
 object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  
int(4) } }


I am thinking that do both codes in if statement,
but $this-items[$id] += $count; exec after send page.



I am using PHP Version 5.2.6 and Smarty v.2.6.19

Thanks for help :)






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



[PHP] Bug in array_key_exist?

2008-08-26 Thread Korgan

Hi,
I have a problem with array_key_exists in if statement.

I have a class with this function

class XXX {
private items = array();
...
...
...

public function addXXX($id, $count)
{
   $count = (int)$cout;
if (!array_key_exists($id, $this-items))
   $this-items[$id] = $count;
else
   $this-items[$id] += $count;
}

...
...

}

And I want to send instance of this class with SESSION.
If I add a item to the array, count is ok, but if i go to the next page 
count will change.



There is the code of index.php

 /** its loading classes ***/
 spl_autoload_register('loadClass');

 session_start();
 var_dump($_SESSION['XX']); /** A **/

 
 ...
 ...
 ...
 if ($_SESSION['XX'] instanceof XXX)
$x = $_SESSION['XX'];
  else
new...
  ..
  ..
  /** Do onzl this **/
  if 
$x-addXXX($id, $cnt);


  
  ...
  ...
  $_SESSION['XX'] = X;
  var_dump($_SESSION['XX']); /** B **/


There is a vardump if action addXXX exec:
   A:
object(Kosik)#1 (1) { [zbozi:private]=  array(0) { } }

   B:
object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  int(1) } }

And than i will go to some page and vardums are:
   A:
	object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  int(4) } } 
1 : 4


   B:
 object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  int(4) } }

I am thinking that do both codes in if statement,
but $this-items[$id] += $count; exec after send page.



I am using PHP Version 5.2.6 and Smarty v.2.6.19

Thanks for help :)


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



Re: [PHP] Bug in array_key_exist?

2008-08-26 Thread Jim Lucas

Korgan wrote:

Hi,
I have a problem with array_key_exists in if statement.

I have a class with this function

class XXX {
private items = array();
...
...
...

public function addXXX($id, $count)
{
   $count = (int)$cout;


 Let me point at it 

Check your spelling

If error_reporting was set to E_ALL AND display_errors were turned on, you would see that you are 
using an undefined variable in your method called $cout, casting is as an int and assigning the 
resulting value (which would always be zero) to $count.



if (!array_key_exists($id, $this-items))
   $this-items[$id] = $count;
else
   $this-items[$id] += $count;
}

...
...

}

And I want to send instance of this class with SESSION.
If I add a item to the array, count is ok, but if i go to the next page 
count will change.



There is the code of index.php

 /** its loading classes ***/
 spl_autoload_register('loadClass');

 session_start();
 var_dump($_SESSION['XX']); /** A **/

 
 ...
 ...
 ...
 if ($_SESSION['XX'] instanceof XXX)
$x = $_SESSION['XX'];
  else
new...
  ..
  ..
  /** Do onzl this **/
  if 
$x-addXXX($id, $cnt);


  
  ...
  ...
  $_SESSION['XX'] = X;
  var_dump($_SESSION['XX']); /** B **/


There is a vardump if action addXXX exec:
   A:
object(Kosik)#1 (1) { [zbozi:private]=  array(0) { } }

   B:
object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  int(1) } }

And than i will go to some page and vardums are:
   A:
object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  int(4) 
} } 1 : 4


   B:
 object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  int(4) 
} }


I am thinking that do both codes in if statement,
but $this-items[$id] += $count; exec after send page.



I am using PHP Version 5.2.6 and Smarty v.2.6.19

Thanks for help :)





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



Re: [PHP] Bug in array_key_exist?

2008-08-26 Thread Korgan

Jim Lucas napsal(a):

Korgan wrote:

Hi,
I have a problem with array_key_exists in if statement.

I have a class with this function

class XXX {
private items = array();
...
...
...

public function addXXX($id, $count)
{
   $count = (int)$cout;


 Let me point at it 

Check your spelling

If error_reporting was set to E_ALL AND display_errors were turned on, 
you would see that you are using an undefined variable in your method 
called $cout, casting is as an int and assigning the resulting value 
(which would always be zero) to $count.


No variable $count is mandatory so that is defined.
But its not main idea of my question...
Function add items correctly, but if go to next page, values in array 
change. Values are changed passing from one page to another one, why and 
where?



if (!array_key_exists($id, $this-items))
   $this-items[$id] = $count;
else
   $this-items[$id] += $count;
}

...
...

}

And I want to send instance of this class with SESSION.
If I add a item to the array, count is ok, but if i go to the next 
page count will change.



There is the code of index.php

 /** its loading classes ***/
 spl_autoload_register('loadClass');

 session_start();
 var_dump($_SESSION['XX']); /** A **/

 
 ...
 ...
 ...
 if ($_SESSION['XX'] instanceof XXX)
$x = $_SESSION['XX'];
  else
new...
  ..
  ..
  /** Do onzl this **/
  if 
$x-addXXX($id, $cnt);


  
  ...
  ...
  $_SESSION['XX'] = X;
  var_dump($_SESSION['XX']); /** B **/


There is a vardump if action addXXX exec:
   A:
object(Kosik)#1 (1) { [zbozi:private]=  array(0) { } }

   B:
object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  
int(1) } }


And than i will go to some page and vardums are:
   A:
object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  
int(4) } } 1 : 4


   B:
 object(Kosik)#1 (1) { [zbozi:private]=  array(1) { [1]=  
int(4) } }


I am thinking that do both codes in if statement,
but $this-items[$id] += $count; exec after send page.



I am using PHP Version 5.2.6 and Smarty v.2.6.19

Thanks for help :)






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



[PHP] Bug in SimpleXML?

2008-06-02 Thread Kyle Browning
I was working on a project for XML Parsing. I came across instances where my
elements were completely missing.

After further Digging into the issue, I found out, that when placing tags
inside of an element with text, SimpleXML (and dom Document) ignore the
added tags, and the text within.

Heres an example.

---ok.xml-
?xml version=1.0 encoding=UTF-8 standalone=yes?
Document
Article
Title pagenum=84 docname=Career Path mar 08Is Your
Face on Facebook? /Title
SubtitleEmploy simple strategies to market your ?profile?
using online social networking./Subtitle
BodyTemp Testing Example of SimpleXML Bug.bIs it a bug
though?/b/Body
FolioTrying to just show Examples/Folio
/Article
/Document
---ok.xml-

---ok.php-
?php

$file = file_get_contents('ok.xml');
$xml = new SimpleXMLElement($file);

print_r($xml);
print $xml-Article-Body-b . \n;
---ok.php-


---output-
SimpleXMLElement Object
(
[Article] = SimpleXMLElement Object
(
[Title] = Is Your Face on Facebook?
[Subtitle] = Employ simple strategies to market your ?profile?
using online social networking.
[Body] = Temp Testing Example of SimpleXML Bug.
[Folio] = Trying to just show Examples
)

)
Is it a bug though?
---output-




Furthermore if I place b tags at the beginning of of the Body tags
ie.

BodybTesting/bTemp Testing Example of SimpleXML Bug.bIs it a bug
though?/b/Body

The text between the /b and b is ignored and is output as follows..

---output---
SimpleXMLElement Object
(
[Article] = SimpleXMLElement Object
(
[Title] = Is Your Face on Facebook?
[Subtitle] = Employ simple strategies to market your ?profile?
using online social networking.
[Body] = SimpleXMLElement Object
(
[b] = Array
(
[0] = Testing
[1] = Is it a bug though?
)

)

[Folio] = Trying to just show Examples
)

)
Testing
---output---

The above output is using ok.php.

Is this working as intended?


Re: [PHP] Bug in SimpleXML?

2008-06-02 Thread Nathan Nobbe
On Mon, Jun 2, 2008 at 3:12 PM, Kyle Browning [EMAIL PROTECTED] wrote:

 I was working on a project for XML Parsing. I came across instances where
 my
 elements were completely missing.

 After further Digging into the issue, I found out, that when placing tags
 inside of an element with text, SimpleXML (and dom Document) ignore the
 added tags, and the text within.


thats a known limitation. i have written a workaround in some code for a
personal project, but it cant be great for performance.  anyway, another
option is to use DOM.


 ---output-
 SimpleXMLElement Object
 (
[Article] = SimpleXMLElement Object
(
[Title] = Is Your Face on Facebook?
[Subtitle] = Employ simple strategies to market your ?profile?
 using online social networking.
[Body] = Temp Testing Example of SimpleXML Bug.
[Folio] = Trying to just show Examples
)

 )


are you using print_r() or var_dump() to generate this output?  fyi, those
are explicitly not supported by simplexml.

-nathan


Re: [PHP] Bug in SimpleXML?

2008-06-02 Thread Nathan Nobbe
On Mon, Jun 2, 2008 at 4:32 PM, Kyle Browning [EMAIL PROTECTED] wrote:

 I used both print_r and var_dump.
 Whats supported for ultimate nesting prints of values and keys?, or in
 objects words, properties and values.


cc'ng the list again..

well var_dump() and print_r() just arent supported for simplexml, per the
manual,

http://php.oregonstate.edu/manual/en/function.simplexml-element-attributes.php

*Note*: SimpleXML has made a rule of adding iterative properties to most
methods. They cannot be viewed using
var_dump()http://php.oregonstate.edu/manual/en/function.var-dump.phpor
anything else which can examine objects.

basically, youre best bet w/ simplexml is asXML() ;)

-nathan


[PHP] Bug in stream_socket_server()?

2007-12-11 Thread René Fournier
If you want a high speed socket server, use the low-level sockets  
instead (socket_create/bind/listen). The stream_socket_server version  
appears to have internal fixed 8k buffers that will overflow if you  
don't keep up by reading.


This is a serious problem if you an application that reads the socket  
for messages and then, say, saves the result in a database. The delay  
while it is busy processing means you can't read the data in time  
unless you get involved in muti-threading.


With the the low-level functions, the OS quietly buffers TCP/IP  
packets so there is no problem (tested on Windows XP Professional).


( http://php.oregonstate.edu/manual/en/function.stream-socket- 
server.php#67837 )



Has anyone confirmed this? I am doing tests with a stripped-down  
multi-client socket server, wonder if this issue is causing some of  
the problems I've seen.


...Rene

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



[PHP] Bug with passing objects by reference and assigning a defeault null?

2007-04-06 Thread Shu Chow
Has anyone tried to assign a default value of null for an object passed 
by reference in PHP4?


Let's say I had this code:

  $mObj = new testModel();
  $mObj-msg = Bubba;

  testFunc();

  class testModel {
var $msg;
  }

  function testFunc($msg=null) {
echo $msg-msg;
  }

Under PHP5, this works fine.

Under PHP4, the = will cause an error:  Parse error: syntax error, 
unexpected '=', expecting ')'.  Removing the  in the parameter 
definition makes it work.  I'm using 4.4.2 right now, but don't see 
anything in the later change logs that say this was fixed.  I also don't 
find any mention of it in the bugs list.  Is this a legit bug or am I 
committing a big no-no?


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



Re: [PHP] Bug with passing objects by reference and assigning a defeault null?

2007-04-06 Thread Robert Cummings
On Fri, 2007-04-06 at 12:19 -0400, Shu Chow wrote:
 Has anyone tried to assign a default value of null for an object passed 
 by reference in PHP4?
 
 Let's say I had this code:
 
$mObj = new testModel();
$mObj-msg = Bubba;
 
testFunc();
 
class testModel {
  var $msg;
}
 
function testFunc($msg=null) {
  echo $msg-msg;
}
 
 Under PHP5, this works fine.
 
 Under PHP4, the = will cause an error:  Parse error: syntax error, 
 unexpected '=', expecting ')'.  Removing the  in the parameter 
 definition makes it work.  I'm using 4.4.2 right now, but don't see 
 anything in the later change logs that say this was fixed.  I also don't 
 find any mention of it in the bugs list.  Is this a legit bug or am I 
 committing a big no-no?

Not a bug, it's a limitation of PHP4.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



[PHP] Help with the php bug in the Squirrelmail plugin's script

2007-03-09 Thread Jevos, Peter

Hi 
I'd like to ask you for the help
I'm using Squirellmail with plugin Shared calendar. This is simple nice
plugin written by Paul Lesniewski
But I found the bug in this plugin. The bug seems to be related with
variable and memory.
The scripts are really slow and sometimes takes 20-30 seconds under some
conditions.
Unfortunately Paul is busy and has no time to examine it. Just told me
that it seems like there is a problem in that all files are inspected
even when it just needs to look for one file.
I found out what caused this delay and what action but I'm not good
programmer therefore I cannot repair it by myself
Can anybody look at this plugin and bug ? I can provide more information
Can anybody give me some advice how to proceed?

Thanks

Pet

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



Re: [PHP] Help with the php bug in the Squirrelmail plugin's script

2007-03-09 Thread Tijnema !

If there are no people willing to, i am, but i don't have a lot of time.
I hope it isn't urgent.

Tijnema


On 3/9/07, Jevos, Peter [EMAIL PROTECTED] wrote:



Hi
I'd like to ask you for the help
I'm using Squirellmail with plugin Shared calendar. This is simple nice
plugin written by Paul Lesniewski
But I found the bug in this plugin. The bug seems to be related with
variable and memory.
The scripts are really slow and sometimes takes 20-30 seconds under some
conditions.
Unfortunately Paul is busy and has no time to examine it. Just told me
that it seems like there is a problem in that all files are inspected
even when it just needs to look for one file.
I found out what caused this delay and what action but I'm not good
programmer therefore I cannot repair it by myself
Can anybody look at this plugin and bug ? I can provide more information
Can anybody give me some advice how to proceed?

Thanks

Pet

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




[PHP] Re: Help with the php bug in the Squirrelmail plugin's script

2007-03-09 Thread Mark
Jevos, Peter wrote:

 
 Hi
 I'd like to ask you for the help
 I'm using Squirellmail with plugin Shared calendar. This is simple nice
 plugin written by Paul Lesniewski
 But I found the bug in this plugin. The bug seems to be related with
 variable and memory.
 The scripts are really slow and sometimes takes 20-30 seconds under some
 conditions.
 Unfortunately Paul is busy and has no time to examine it. Just told me
 that it seems like there is a problem in that all files are inspected
 even when it just needs to look for one file.
 I found out what caused this delay and what action but I'm not good
 programmer therefore I cannot repair it by myself
 Can anybody look at this plugin and bug ? I can provide more information
 Can anybody give me some advice how to proceed?


You should post AS MUCH information as you have, that way someone can look
at it and decide if it is something they can do right away.

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



RE: [PHP] Re: Help with the php bug in the Squirrelmail plugin's script

2007-03-09 Thread Jevos, Peter
 
  
  Hi
  I'd like to ask you for the help
  I'm using Squirellmail with plugin Shared calendar. This is simple 
  nice plugin written by Paul Lesniewski But I found the bug in this 
  plugin. The bug seems to be related with variable and memory.
  The scripts are really slow and sometimes takes 20-30 seconds under 
  some conditions.
  Unfortunately Paul is busy and has no time to examine it. 
 Just told me 
  that it seems like there is a problem in that all files are 
 inspected 
  even when it just needs to look for one file.
  I found out what caused this delay and what action but I'm not good 
  programmer therefore I cannot repair it by myself Can 
 anybody look at 
  this plugin and bug ? I can provide more information Can 
 anybody give 
  me some advice how to proceed?
 
 
 You should post AS MUCH information as you have, that way 
 someone can look at it and decide if it is something they can 
 do right away.

So I hope this can tells more

The plugin is using file backend for user calendar data.
The structure is simple:

data_dir
  |
  | calendar_data
 |
 | private_calendars
 |   |
 |   |- iCal files containing only calendar info
 |  for user personal calendars
 |
 | public_calendars
 |   |
 |   |- iCal files containing only calendar info
 |  for public calendars

 


Problem is with files stored in the private calendars folder. There are
files related to users. In my case there is thousands files. When I
deleted this files plugin run without any problem. When the count of
files is increasing it's getting worst
 Here is the answer from Paul: seems like there is a problem in that all
users are inspected even when it just needs to look for one user When
user files has increased the scripts stopped running and I got error:
Allowed memory size of 33554432 bytes exhausted (tried to allocate
128bytes)

I had to increased memory_limit = 64M in php.ini but this is temporaly
solution that force the plugin to work

So it seems there is problem with variable $calId that is responsible
for unique names of the private calendars But I cannot redefine it or
change it I think it is necessary to install this plugin with SM

Thanks a lot

PEt

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



Re: [PHP] Bug? (_ENV in PHP v5.2.0)

2007-01-16 Thread Frank M. Kromann
Hi Eli,

Check variable_order in php.ini
(http://us2.php.net/manual/en/ini.core.php#ini.variables-order) if the E is
missing you will not get any environment variables.

- Frank

 Hi,
 
 System:
   Win32
   PHP 5.2.0
   Apache 2.0.54 (PHP in CGI mode)
 
 CGI vars are not automatically loaded into $_ENV global array. Only when

 calling getenv('var'), just then the variable appears in $_ENV.
 Besides, it seems that the env vars are loaded automatically into 
 $_SERVER. And $HTTP_ENV_VARS is always NULL.
 
 
 ?php
 echo before getenv...;
 echo br\$_ENV: ; var_dump($_ENV);
 echo br\$HTTP_ENV_VARS: ; var_dump($HTTP_ENV_VARS);
 
 getenv('SERVER_PROTOCOL');
 echo hrafter getenv...;
 echo br\$_ENV: ; var_dump($_ENV);
 echo br\$HTTP_ENV_VARS: ; var_dump($HTTP_ENV_VARS);
 ?
 
 === output:
 before getenv...
 $_ENV: array(0) { }
 $HTTP_ENV_VARS: NULL


 after getenv...
 $_ENV: array(1) { [SERVER_PROTOCOL]= string(8) HTTP/1.1 }
 $HTTP_ENV_VARS: NULL
 
 
 Is it a bug? Or this is the way it should work?
 
 
 -thanks, Eli
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 

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



Re: [PHP] Bug? (_ENV in PHP v5.2.0)

2007-01-16 Thread Eli

Frank M. Kromann wrote:

Hi Eli,

Check variable_order in php.ini
(http://us2.php.net/manual/en/ini.core.php#ini.variables-order) if the E is
missing you will not get any environment variables.

- Frank



Thanks, Frank.. That worked! :-)

-thanks, Eli

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



[PHP] Bug? (_ENV in PHP v5.2.0)

2007-01-15 Thread Eli

Hi,

System:
Win32
PHP 5.2.0
Apache 2.0.54 (PHP in CGI mode)

CGI vars are not automatically loaded into $_ENV global array. Only when 
calling getenv('var'), just then the variable appears in $_ENV.
Besides, it seems that the env vars are loaded automatically into 
$_SERVER. And $HTTP_ENV_VARS is always NULL.



?php
echo before getenv...;
echo br\$_ENV: ; var_dump($_ENV);
echo br\$HTTP_ENV_VARS: ; var_dump($HTTP_ENV_VARS);

getenv('SERVER_PROTOCOL');
echo hrafter getenv...;
echo br\$_ENV: ; var_dump($_ENV);
echo br\$HTTP_ENV_VARS: ; var_dump($HTTP_ENV_VARS);
?

=== output:
before getenv...
$_ENV: array(0) { }
$HTTP_ENV_VARS: NULL

after getenv...
$_ENV: array(1) { [SERVER_PROTOCOL]= string(8) HTTP/1.1 }
$HTTP_ENV_VARS: NULL


Is it a bug? Or this is the way it should work?


-thanks, Eli

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



[PHP] Bug in == comparison?

2006-07-21 Thread Jeffrey Sambells


OK I have a very strange bug:

In the middle of my script I have these two lines:

var_dump($test,$test2);
echo '$test'=='$test2' is .($test==$test2);

which is giving:

int(0) string(6) Points
'0'=='Points' is 1

I understand that PHP is loose typed and automatically does type  
conversion but in the many years I've been using PHP (mostly v4) the  
comparison had always converted to 'string' and in the case above  
returned FALSE, not TRUE. It seems here they are comparing as  
integers thus 'Points' evaluates to 0 and the comparison is TRUE.


I tried comparing in the  reverse sequence ($test2==$test) and the  
same occurred. It does work as expected if I have === but the rest of  
the scirpt isn't type sensitive so I want NULL, 0, and empty string  
to still maintain equality.


Any ideas why this is suddenly happening? I'm using PHP 5.1, and I  
realize I could use other functions such as strval() in the  
comparison however I've used similar logic in the past without problems.


Any help would be great.

Thanks

Jeff



~~
Jeffrey Sambells
Director of Research and Development
Zend Certified Engineer (ZCE)

We-Create Inc.
[EMAIL PROTECTED] email
519.745.7374 x103 office
519.897.2552 mobile

~~
Get Mozilla Firefox at
http://spreadfirefox.com

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



[PHP] PHP Bug Tracking

2006-07-06 Thread Chris Hemmings
Can anyone point me in the direction where I can find a place to 
download the bug track system that PHP/PEAR  PECL uses.  I seem to 
remember it is available but can't find it anymore!


Ta!

Chris.

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



Re: [PHP] PHP Bug Tracking

2006-07-06 Thread Dan McCullough

This one?
http://dev.mysql.com/downloads/other/eventum/

On 7/6/06, Chris Hemmings [EMAIL PROTECTED] wrote:

Can anyone point me in the direction where I can find a place to
download the bug track system that PHP/PEAR  PECL uses.  I seem to
remember it is available but can't find it anymore!

Ta!

Chris.

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




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



Re: [PHP] PHP Bug Tracking

2006-07-06 Thread Chris Hemmings

Dan McCullough wrote:

This one?
http://dev.mysql.com/downloads/other/eventum/

On 7/6/06, Chris Hemmings [EMAIL PROTECTED] wrote:


Can anyone point me in the direction where I can find a place to
download the bug track system that PHP/PEAR  PECL uses.  I seem to
remember it is available but can't find it anymore!

Ta!

Chris.

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



Cheers Dan,

Looks like the one :-)

http://www.mysqltalk.org/what-software-is-used-by-bugsmysqlcom-vt10767.html

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



Re: [PHP] PHP Bug Tracking

2006-07-06 Thread Dan McCullough

I just installed it so its fresh in my mind.

:)

On 7/6/06, Chris Hemmings [EMAIL PROTECTED] wrote:

Dan McCullough wrote:
 This one?
 http://dev.mysql.com/downloads/other/eventum/

 On 7/6/06, Chris Hemmings [EMAIL PROTECTED] wrote:

 Can anyone point me in the direction where I can find a place to
 download the bug track system that PHP/PEAR  PECL uses.  I seem to
 remember it is available but can't find it anymore!

 Ta!

 Chris.

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


Cheers Dan,

Looks like the one :-)

http://www.mysqltalk.org/what-software-is-used-by-bugsmysqlcom-vt10767.html

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




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



[PHP] bug in php 5.1.4

2006-06-30 Thread Alain Roger

Hi,

I' ve discovered a bug in PHP 5.1.4. This version of PHP create a new
session everytime you refresh the same php page or that you switch from 1
page to another page.
I downgraded it to PHP 5.1.2 and it works correctly.
It could be interesting to fix this bug.

if you want moredetail, contact me.

Alain


Re: [PHP] bug in php 5.1.4

2006-06-30 Thread Thomas Munz
There must be a special code in your script that causes it like this bug:

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

on Friday 30 June 2006 11:39, Alain Roger wrote:
 Hi,

 I' ve discovered a bug in PHP 5.1.4. This version of PHP create a new
 session everytime you refresh the same php page or that you switch from 1
 page to another page.
 I downgraded it to PHP 5.1.2 and it works correctly.
 It could be interesting to fix this bug.

 if you want moredetail, contact me.

 Alain

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



Re: [PHP] bug in php 5.1.4

2006-06-30 Thread Jochem Maas
Alain Roger wrote:
 Hi,
 
 I' ve discovered a bug in PHP 5.1.4. This version of PHP create a new
 session everytime you refresh the same php page or that you switch from 1
 page to another page.
 I downgraded it to PHP 5.1.2 and it works correctly.
 It could be interesting to fix this bug.

if it is a bug it sounds like it's rather critical!

 
 if you want moredetail, contact me.

you might want to post a small repro script to internals to illustrate the
problem... if you do you better off asking if it is a bug rather than declaring
it to be so.

chances are that you'll be asked to make a report at bugs.php.net if someone 
sees
merit in your observation.

 
 Alain
 

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



[PHP] Bug in XMLWriter?

2006-05-19 Thread D. Dante Lorenso
I am using XMLWriter with PHP 5.1.4 and find that it doesn't behave as I 
expect.  I am under the impressing that until I call 'endElement', I 
should be free to continue adding attributes to an opened element 
regardless of whether I have already added elements or text below it. 
Look at this sample code:


?php
//--
// create an object to write to an in-memory buffer
$XML = new XMLWriter();
$XML-openMemory();

// start new element and add 1 attribute
$XML-startElement(a);
$XML-writeAttribute(href, http://www.google.com;);

// add a text node
$XML-text(Google);

// add another attribute (DOES NOT WORK)
$XML-writeAttribute(target, _blank);

// add more text
$XML-text( Go There);

// end the element and output so we can see what we have
$XML-endElement();
print htmlspecialchars($XML-outputMemory());
//--
?

output: a href=http://www.google.com;Google Go There/a

If you notice, the 'target=_blank' attribute was silently ignored.  
However, if I move that statement above the -text() method call, it 
will work as expected.  Is this a bug or a feature I don't know about?


Dante

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



[PHP] Bug madness

2006-04-27 Thread Dave Goodchild
Hi all, I have been mashing my head trying to debug a web app I have
written, the deadline is tomorrow and after implementing some changes a
subtle and difficult-to-pin-down bug has emerged.

I am not going to include code as there is too much of it, but here is the
general issue:

The app consists of three linked forms and three modules that process the
data passed in from the forms. All was sweet and perfect before today. The
forms are self-reloading, and after the data is checked, validated and
entered into the database the form is supposed to display a thank you
section. As part of the processing process (!), the scripts assemble and
send multipart mails to the entrants.

Now, when I submit the forms, I see a blank page - nothing, no html, no
error messages. I have added debugging functions at each point to track the
logic and they inform me that the processing functions get to the end (where
the mails are sent) where they should return to the caller (ie the form).
This does not happen. I have display_errors enabled and cannot seem to
locate the source of this issue.

Ambiguous I know, but it may be a recognisable issue to many of you, in
which case any advice would be greatly appreciated.

I am extremely calm.

--
http://www.web-buddha.co.uk

dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css)

look out for project karma, our new venture, coming soon!


RE: [PHP] Bug madness

2006-04-27 Thread Jeremy Schreckhise
Have you tried?

error_reporting(E_ALL^E_NOTICE); 

Jeremy Schreckhise, M.B.A.


-Original Message-
From: Dave Goodchild [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 27, 2006 10:37 AM
To: php-general@lists.php.net
Subject: [PHP] Bug madness

Hi all, I have been mashing my head trying to debug a web app I have
written, the deadline is tomorrow and after implementing some changes a
subtle and difficult-to-pin-down bug has emerged.

I am not going to include code as there is too much of it, but here is the
general issue:

The app consists of three linked forms and three modules that process the
data passed in from the forms. All was sweet and perfect before today. The
forms are self-reloading, and after the data is checked, validated and
entered into the database the form is supposed to display a thank you
section. As part of the processing process (!), the scripts assemble and
send multipart mails to the entrants.

Now, when I submit the forms, I see a blank page - nothing, no html, no
error messages. I have added debugging functions at each point to track the
logic and they inform me that the processing functions get to the end (where
the mails are sent) where they should return to the caller (ie the form).
This does not happen. I have display_errors enabled and cannot seem to
locate the source of this issue.

Ambiguous I know, but it may be a recognisable issue to many of you, in
which case any advice would be greatly appreciated.

I am extremely calm.

--
http://www.web-buddha.co.uk

dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css)

look out for project karma, our new venture, coming soon!

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



RE: [PHP] Bug madness

2006-04-27 Thread Paul Scott
On Thu, 2006-04-27 at 10:48 -0500, Jeremy Schreckhise wrote:
 Have you tried?
 
   error_reporting(E_ALL^E_NOTICE); 

Surely you mean error_reporting(E_ALL);?

If one of my team members ships code that does not pass through on E_ALL
(or E_STRICT), they get a beating.

Now, back to the problem at hand...

Are you 100% certain that your sendmail binary is available and the
correct path set? I presume you are using the native mail() function?
Thats probably where you are having issues. Also your script may be
timing out because sendmail can't resolve a FQDN or something?

--Paul

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



[PHP] (Apache|php) Bug using modproxy

2006-04-26 Thread Lmwangi
Hi all,
 First time on the list... sorry for any errs.
 I am using mod_proxy to pass requests to an internal server in our
lan. The setup looks like

Enduser---INet_link-Mod_proxy_serverLan---PHP_script

Now,

this  does not work:

Enduser---https---Apache_mod_proxy-http---Destination_server.

* When a user submits a form (php) with a file upload and  $_POST
vars, the $_POST array is mangled (missing) elements and the $_FILES
array is empty

while this works:

 Enduser---http---Apache_mod_proxy-http---Destination_server.

* When a user submits a form with a file upload and  $_POST vars,
Everything is all good
lmwangi

So something bad? happens when you use https in the request. Anyone
able to reproduce this. Is it a php bug (i doubt it) but you never
know until u waddle through the mod_proxy voodoo.
Here is a sample script


snip

?php
if(isset($_POST['btnSubmit'])){
print_r($_POST);
print_r($_FILES);
}
else{
?
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0
Strict//ENhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;

html xmlns=http://www.w3.org/1999/xhtml;
 head
  meta http-equiv=Content-Type content=text/html; charset=utf-8 /
  titlePost Test/title
 /head

body
form action=?php echo $_SERVER['PHP_SELF']? method=post
name=frm_add_content id=frm_add_content
enctype=multipart/form-data
div
input name=id type=hidden value=0 /
input name=MAX_FILE_SIZE type=hidden value=2097152 /
table border=0

tr
td style=white-space: nowrap; background-color:
#CC; align=left valign=top colspan=2bAdd Media/b/td
/tr
tr
td align=right valign=topspan style=color:
#ff*/spanbMedia id/b/td
td valign=top align=leftinput class=inputbox
name=mediaid type=text //td
/tr

tr
td align=right valign=topbMedia File/b/td
td valign=top align=leftinput class=inputbox
name=mms_media type=file //td
/tr
tr
td align=right valign=topspan style=color:
#ff*/spanbSubject/b/td
td valign=top align=leftinput class=inputbox
name=subject type=text //td

/tr
tr
td align=right valign=topbMessage Body/b/td
td valign=top align=lefttextarea
class=inputbox name=msg_body/textarea/td
/tr
tr
tr

td align=right valign=topb/b/td
td valign=top align=leftinput class=button
name=btnClear value=Clear type=reset /nbsp;input
class=button name=btnSubmit value=Submit type=submit //td
/tr
tr
td/td
td align=left valign=topspan style=font-size:80%;
color:#ff;*/spanspan style=font-size:80%; denotes required
field/span/td
/tr

/table
/div
/form
/body
/html
?php
}
?
/snip

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



Re: [PHP] (Apache|php) Bug using modproxy

2006-04-26 Thread Jochem Maas



Lmwangi wrote:

Hi all,
 First time on the list... sorry for any errs.
 I am using mod_proxy to pass requests to an internal server in our
lan. The setup looks like

Enduser---INet_link-Mod_proxy_serverLan---PHP_script

Now,

this  does not work:

Enduser---https---Apache_mod_proxy-http---Destination_server.

* When a user submits a form (php) with a file upload and  $_POST
vars, the $_POST array is mangled (missing) elements and the $_FILES
array is empty

while this works:

 Enduser---http---Apache_mod_proxy-http---Destination_server.


almost definitely not a php problem - maybe using ProxyPass instead of
mod_proxy would work (probably requires https connection on the destination
server) - personally I have used Squid as a reverse proxy for this kind of
setup and let it deal with the https--http conversion - it works but if you
think the Apache stuff is voodoo then I need a new name for the Squid 
configuration
stuff ;-)

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



Re: [PHP] (Apache|php) Bug using modproxy

2006-04-26 Thread Oscar Gosdinski
I have the configuration you described:

browser -- https- mod_proxy - http - php

and i don't have any problem with it. Maybe it's an Apache
misconfiguration. Can you send a snap of your httpd.conf?

On 4/26/06, Lmwangi [EMAIL PROTECTED] wrote:
 Hi all,
  First time on the list... sorry for any errs.
  I am using mod_proxy to pass requests to an internal server in our
 lan. The setup looks like

 Enduser---INet_link-Mod_proxy_serverLan---PHP_script

 Now,

 this  does not work:

 Enduser---https---Apache_mod_proxy-http---Destination_server.

 * When a user submits a form (php) with a file upload and  $_POST
 vars, the $_POST array is mangled (missing) elements and the $_FILES
 array is empty


--
Saludos
Oscar

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



  1   2   3   4   >