Re: [PHP-DEV] patch to sapi/servlet fixes bug 21291 more, pleaseapply to STABLE/HEAD
Giuseppe Tanzilli - CSF wrote: this patch fixes all this problems, I committed your patch, although I can't test it at the moment. Who is the maintainer of this sapi module ? Sam Ruby. Just kidding. The SAPI Servlet module is unmaintained at the moment. Maybe this will change once the new Java extension is available. -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: aggregation stability
As a further note, it appears that the issue may involve the deaggregate() function. When used as deaggregate($this), it seems to cause a crash. This is the only link to crashing I've found. If I can isolate it, I'll post a bug to the tracker. Greg Greg Beaver [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, How stable is aggregation considered to be for PHP 4.3.0 release? I've been getting crashes with apache 1.3.27/php 4.3.0/Win98SE in certain cases when calling a overriding method of an aggregated class. class A { function display() { } } class B extends A { function display() { } } class D { function test() { $this-display(); } } class C { function aggtest() { aggregate($this,'B'); aggregate($this,'D'); $this-test(); } } The code above works on my system, and demonstrates the general principle that I'm using. In some cases, just adding a flush();exit; causes an apache crash. In others, adding a call to a function crashes things. There is absolutely nothing consistent. I would like to attach a sample script that causes a crash, but I can't find anything smaller than the 25 files I have which will cause one. Has anyone else experienced this bizarre behavior? What can I do to find the bug or help others find it? I don't even know if it has anything to do with aggregation. The only consistency is that when I call an aggregated function from another class's aggregated function after deaggregating and then re-aggregating, it seems to get unstable. I can't find anything else that when I add it in causes a crash, and stops when I take it out. Thanks, Greg -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Apache2Filter SAPI segfaults
Sebastian Bergmann wrote: [...] I get a segfault with the same backtrace for Apache 1.3. -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Can't build PHP_4_3+ZE1 on Win32
Sebastian Bergmann wrote: [...] I just checked out '-r php_4_3_0' and get the same linker errors. I have no idea what might be causing this... -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: [PHP-CVS] cvs: php4 /sapi/apache2filter php_functions.c
Moriyoshi Koizumi wrote: moriyoshi Sat Jan 11 17:36:38 2003 EDT Modified files: /php4/sapi/apache2filter php_functions.c Log: This patch is likely to fix win32 build I (still) get sapi_apache2.c(538): error C2039: '_free_dbg' is not an element of 'apr_bucket' -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Re: php4 /ext/standard file.c formatted_print.c
I might be misunderstanding the problem and I didn't have time to read the phrack article, but doesn't this mean that leaving it unsigned is better? It wouldn't pass the length check and thus, memcpy() wouldn't convert a negative number to something huge. The problem is that every single line of existing PHP extensions, both public and non-public, would need to be audited, if we were to switch the type, because 100% of the current code misinterpretes data from the ZE2 API right now. Changing the API does not solve the existing problem, it merely adds to it. For example, you can add a single central check to the engine today which checks string lengths to be at least 0. If the length field was changed to an unsigned type permanently, such a check would be impossible to implement in a portable way, because C does not define how a negative number will appear when cast to an unsigned type. - Sascha -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] php editor
is there a php editor which supports the tree-view for the code itself. I believe tools like visual basic uses this option. You can easily collapse pieces of code, for example a function or a class. Is there any place where i can download a tool like this? And if there's not, what is your favourite editor? i use ultraedit / dreamweaver mx.. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DEV] php editor
Not exactly the right place for this question!! Active state have this feature in their Komodo product for code folding. http://www.activestate.com/ It is a requested feature for Zend Studio and will come soon. http://www.zend.com/--- (my preference) Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Hannes Smit [mailto:[EMAIL PROTECTED]] Sent: Sunday, 12 January 2003 11:49 PM To: [EMAIL PROTECTED] Subject: [PHP-DEV] php editor is there a php editor which supports the tree-view for the code itself. I believe tools like visual basic uses this option. You can easily collapse pieces of code, for example a function or a class. Is there any place where i can download a tool like this? And if there's not, what is your favourite editor? i use ultraedit / dreamweaver mx.. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Moving extensions to PECL
Hello, In my opinion, one of the goals of PHP5 is to reduce the codebase size by moving most of the extensions to PECL. We should start doing this sometime in the near future, if we want PHP5 released this year. Currently, there are few problems with the handling of PECL extensions in the PEAR installer, the biggest is the lack of solution for precompiled dlls for Windows and some more problems in pear installer under win32. I propose to start moving extensions ASAP to PECL in order to get the right momentum for fixing the bugs in PEAR installer and finding a solution for the precompiled dlls. I really don't mind starting with fribidi, which I am maintaining :) Tal -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] RE: cvs checkout skip dir
I am actually pondering about removing distrobutions from phpweb, and moving it to it's own cvs module, with slightly more heavier control over it. This is to be a bit more secure over releases, and also it is usually not needed during a checkout of phpweb. (if you're going to checkout phpweb, you're usually just working on the site, not actually keeping a local copy, rsync is fine for that). if no-one objects i'm going to go ahead and do this next week. -- james -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 11, 2003 1:45 PM To: [EMAIL PROTECTED] Subject: Re: cvs checkout skip dir I don't think its possible... or we should create a tag that does that... -- Regards. M.CHAILLAN Nicolas [EMAIL PROTECTED] www.WorldAKT.com Hébergement de sites internets. Gabor Hojtsy [EMAIL PROTECTED] a écrit dans le message de news: 013f01c2b970$e5f72410$[EMAIL PROTECTED] Hi! Can someone please help me with a hint on what command line argument should I pass to CVS to skip one more more folders while doing a checkout? I would be rather happy to check out phpweb without distributions ;)) Thanks, Goba -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: cvs checkout skip dir
I am actually pondering about removing distrobutions from phpweb, and moving it to it's own cvs module, with slightly more heavier control over it. This is to be a bit more secure over releases, and also it is usually not needed during a checkout of phpweb. (if you're going to checkout phpweb, you're usually just working on the site, not actually keeping a local copy, rsync is fine for that). if no-one objects i'm going to go ahead and do this next week. Please do! And please turn on cvs mails again (without diifs) for changes in distributions. It would be quite nice to see when it changes. We don't receive any notice about it right now... Goba -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] RE: cvs checkout skip dir
hmm. that is an interesting idea... hacking the dolog.pl script to publish the diffs for large attachements instead of including them inline might not be a bad thing (tm). -- james -Original Message- From: Gabor Hojtsy [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 12, 2003 5:02 PM To: James Cox; [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: Php-Dev Subject: Re: cvs checkout skip dir I am actually pondering about removing distrobutions from phpweb, and moving it to it's own cvs module, with slightly more heavier control over it. This is to be a bit more secure over releases, and also it is usually not needed during a checkout of phpweb. (if you're going to checkout phpweb, you're usually just working on the site, not actually keeping a local copy, rsync is fine for that). if no-one objects i'm going to go ahead and do this next week. Please do! And please turn on cvs mails again (without diifs) for changes in distributions. It would be quite nice to see when it changes. We don't receive any notice about it right now... Goba -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: cvs checkout skip dir
hmm. that is an interesting idea... hacking the dolog.pl script to publish the diffs for large attachements instead of including them inline might not be a bad thing (tm). Now, **no** cvs mails are sent regarding the distributions dir. It is skipped because the files are big. But diffs cannot be made for images and I guess, the mailer won't try to create diffs for bz2s exes and the like, so it may be easy to turn those mails on again... But please don't test it by adding a large bz2 file ;)) Goba -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] RE: cvs checkout skip dir
heh :0 we could also just do a system(file $_); or whatever to work out what kind of file we're adding... and if it's a binary type file, then just don't diff. for large diffs, like date changes or doc changes, then publishing the diffs at a site like cvs.php.net/diffs/ or similar would also be trivial, i think. -- james -Original Message- From: Gabor Hojtsy [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 12, 2003 5:16 PM To: James Cox; [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: Php-Dev Subject: Re: cvs checkout skip dir hmm. that is an interesting idea... hacking the dolog.pl script to publish the diffs for large attachements instead of including them inline might not be a bad thing (tm). Now, **no** cvs mails are sent regarding the distributions dir. It is skipped because the files are big. But diffs cannot be made for images and I guess, the mailer won't try to create diffs for bz2s exes and the like, so it may be easy to turn those mails on again... But please don't test it by adding a large bz2 file ;)) Goba -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Re: cvs checkout skip dir
we could also just do a system(file $_); or whatever to work out what kind of file we're adding... and if it's a binary type file, then just don't diff. Images and compressed files are not diffed. So if I update Mirrors-htdig.tgz then nobody can see what I have changed in the instructions inside ;) Well, it is a problem for this case, this is why I would like to move the instructions to mirroring-htdig.php and mirroring-stats.php respectiely for the two services. But thats another question :) So cvswrappers defines what files are binary files (not to be diffed). I have added *.bz2, *.zip and *.tar now, so it probably won't be a problem to remove the lines from commitinfo and mail distributions commits again. | # The next two lines prevent massive cvs commit messages from being | # mailed out. It would be nice if we could instead just send the | # commit log for these ones. | .*distributions.* /bin/true Though I am not sure what effects will this have, so I don't do that :) But I would like to see commit messages for distributions on php-mirrors (without diffs ;). for large diffs, like date changes or doc changes, then publishing the diffs at a site like cvs.php.net/diffs/ or similar would also be trivial, i think. Maybe... This is offtrack now... Goba -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PROPOSAL: default value handling
Ok, this was my mistake in missing the Ternary operator enhancement for fluent code (http://marc.theaimsgroup.com/?t=9622016834r=1w=2) discussion thread from last year in the archives. It was not my intention to reopen a dead thread. I did make best effort to do prior research in the archives though. Nyk On Saturday, January 11, 2003, at 12:20 PM, Andi Gutmans wrote: This has been discussed in the past and won't be done. PHP behaves like C where the result of the boolean or operation is true or false. Andi At 12:38 AM 1/11/2003 -0500, Nyk Cowham wrote: As a convert from Perl one of the 'features' I miss from Perl is the short-circuit behavior of the or operand (||) and how it can be used to set default values if a passed value is false (0 or ). Thus, in a passed parameter you can write: $result = $value || $default; In perl if the $value variable is false (0 or empty string) then $value will be set to the default value. In PHP the or operand does not short-circuit in this way. Instead I find myself having to write something like: $result = ($_REQUEST['value']) ? $_REQUEST['value'] : 'my default value'; This is not only ugly and difficult to read but has the redundancy of naming the $_REQUEST['value'] variable twice. Another nice feature of using Perl's short-circuit or operand is that defaults can be chained so: $result = $value || $alt_value || $default; Will return the default only if $value and $alt_value have both evaluated as false. In other words the first expression that evaluates as true (actually 'not false' would be more accurate) will be returned, all preceding and subsequent values will be ignored. I don't propose the || operant in PHP should be short-circuited like Perl, but rather either a new operand or new function be added that would have this specific behavior. As an operand it might look like: $result = $value ?: $alt_value ?: [ ...] ?: $default; // reusing the terniary operator in this context would be a reasonable mnemonic. Alternatively if implemented as a function it might look like: $result = choose($value, $alt_value, [ ... ], $default); I would be happy to volunteer to do the work to provide this feature if there is enough support for it's inclusion. Thoughts? Nyk Cowham -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] PROPOSAL: unless control structure
My apologies if this has been brought up before, but I searched the archives and couldn't find a reference to it. I'm sure this is the sort of thing that would have already been implemented if there was any desire for it among the developers, but I was wondering if anyone had considered adding support for an unless control structure, similar to the one Perl has. I personally find it much more logical in certain cases. For example, compare this: if (!$user-isAdministrator) { header('Location: ...'); exit; } With this: unless ($user-isAdministrator) { header('Location: ...'); exit; } I think the second one is much easier to read. I strive to write code that is self-documenting, so I tend to pick variable names and function names that are pretty self explanatory. I think an unless control structure would go a long way to helping people write self-documenting code. Just a thought, sorry if this is not the proper forum for this sort of thing. -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] PROPOSAL: unless control structure
On Sun, Jan 12, 2003 at 12:53:12PM -0600, Michael Sims wrote: My apologies if this has been brought up before, but I searched the archives and couldn't find a reference to it. I'm sure this is the sort of thing that would have already been implemented if there was any desire for it among the developers, but I was wondering if anyone had considered adding support for an unless control structure, similar to the one Perl has. I personally find it much more logical in certain cases. While it would no doubt be easy to implement, I would consider it unnecessary syntactic sugar. Besides, it actually ends up using _more_ characters (unless(:7, if(!:4) in the long run. -- Jon Parise ([EMAIL PROTECTED]) :: The PHP Project (http://www.php.net/) -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] exception error with apache + php
I've been fiddling with my apache php installation again, and I'm getting exception errors when trying to view a php page. I've enabled a lot of extensions, and I think that the problem lies therein. I've attached some output from my vstudio debugger, wich I hope is enough for you guys to awnser these Q's: - is this a known bug or not (if it's a bug at all)? - should I investigate more, and track it down to (probably) the faulty extension? apache's version is 1.3.27, php is 4.3.0 (win32 zip package), OS is windows 2k. requesting the same php file without ext. loaded works like a charm. with the extensions generates the exception, and continuesly reloads the page, and the output stops halfway through the page at random points. running the same page through the cgi or cli sapi generates a full page, but gives the same error at the end. the non-standard extensions have been compiled against the php4ts.lib etc. from source using visual studio. appologies upfront in case I did something totally stupid, overlooked the obvious, or are in need of a fresh OS. Regards, Sjon. output from debug window: 'Apache.exe': Loaded 'D:\Apache\Apache.exe', No symbols loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\NTDLL.DLL', Exports loaded. 'Apache.exe': Loaded 'D:\Apache\ApacheCore.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\KERNEL32.DLL', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\USER32.DLL', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\GDI32.DLL', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\ADVAPI32.DLL', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\rpcrt4.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\ws2_32.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\msvcrt.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\ws2help.dll', Exports loaded. 'Apache.exe': Loaded 'D:\Apache\Win9xConHook.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\msvcr70.dll', Symbols loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\imm32.dll', Exports loaded. 'Apache.exe': Loaded 'D:\Apache\modules\mod_perl.so', Exports loaded. 'Apache.exe': Loaded 'C:\Perl\bin\perl56.dll', Exports loaded. 'Apache.exe': Loaded 'D:\Apache\modules\mod_php4.so', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\php4ts.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\wsock32.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\OLE32.DLL', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\OLEAUT32.DLL', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\odbc32.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\comctl32.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\COMDLG32.DLL', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\shlwapi.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\SHELL32.DLL', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\odbcint.dll', No symbols loaded. 'Apache.exe': Loaded 'D:\Apache\modules\mod_proxy.so', Exports loaded. 'Apache.exe': Loaded 'D:\Apache\modules\mod_python.so', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\python22.dll', Exports loaded. 'Apache.exe': Loaded 'C:\PHP\extensions\php_activedebug.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\MSVCP60.DLL', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\MSVCIRT.DLL', Exports loaded. 'Apache.exe': Loaded 'C:\PHP\extensions\php_bcompiler.dll', Exports loaded. 'Apache.exe': Loaded 'C:\PHP\extensions\php_bz2.dll', Exports loaded. 'Apache.exe': Loaded 'C:\PHP\extensions\php_cpdf.dll', Exports loaded. 'Apache.exe': Loaded 'C:\PHP\extensions\php_crack.dll', Exports loaded. 'Apache.exe': Loaded 'C:\PHP\extensions\php_curl.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\libeay32.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\ssleay32.dll', Exports loaded. 'Apache.exe': Loaded 'C:\PHP\extensions\php_db.dll', Exports loaded. 'Apache.exe': Loaded 'C:\PHP\extensions\php_dba.dll', Exports loaded. 'Apache.exe': Loaded 'C:\PHP\extensions\php_dbase.dll', Exports loaded. 'Apache.exe': Loaded 'C:\PHP\extensions\php_dbx.dll', Exports loaded. 'Apache.exe': Loaded 'C:\PHP\extensions\php_domxml.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\iconv.dll', Exports loaded. 'Apache.exe': Loaded 'C:\PHP\extensions\php_exif.dll', Exports loaded. 'Apache.exe': Loaded 'C:\PHP\extensions\php_fbsql.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\RNR20.DLL', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\dnsapi.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\IPHLPAPI.DLL', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\icmp.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\mprapi.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\samlib.dll', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\NETAPI32.DLL', Exports loaded. 'Apache.exe': Loaded 'C:\WINNT\system32\secur32.dll', Exports loaded.
Re: [PHP-DEV] PROPOSAL: 'unless' control structure
On Sun, 2003-01-12 at 20:47, Sara Golemon wrote: [...] This has been discussed (recently in fact) and won't be done. However, you *can* give your code the type of readability you're looking for with: ($condition) || { /* This will only run if $condition evals to false */ } Nope, that gives me a parse error: thekid@friebes:~ echo '? function unless($c) { return $c; } $c= FALSE; unless($c) || print(!condition\n); ?' | php -q !condition thekid@friebes:~ echo '? function unless($c) { return $c; } $c= FALSE; unless($c) || { print(!condition\n); } ?' | php -q Parse error: parse error in - on line 1 It'll work for exactly one statement (e.g. mysql_connect() or die()), but not with blocks (mysql_connect() or { mail(...); die(); })). -- Timm Friebe [EMAIL PROTECTED] -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Should I fix this?
At 09:55 7-1-2003, Marcus Börger wrote: At 01:43 07.01.2003, Rickard Andersson wrote: I'd be glad to write a patch for image.c (function php_handle_gif()), but I though I should ask you guys first. I wouldn't want to do it in vain. As it is now I've got PHP code that checks this for me to prevent malicious users from uploading huge avatars in my forum software. Your scenario described above seems like a reason to accept the the speed loss. So send an unified patch and we will have a look on it. I don't agree. An avatar, by nature, has a fixed _image_ size. If you allow variable avatar image sizes, then you still have the option to use that same getimagesize() to set the width and height attributes of the HTML IMG tag and the browser (any browser), will render that image, with the set values. If the image is larger, it will simply scale down proportinally and the fun for the 'malicious haxoreditor' is spoiled already. IIC - your reference for disallowing uploaded images, should be filesize rather than imagesize and as described above, you can use the bug, to restrain any layout problems that arrise. With kind regards, Melvyn Sopacua ?php include(not_reflecting_employers_views.txt); ? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Should I fix this?
Hello, I do not think this is a good solution, and starting to check the internal data of each images (think about bmp or any 'raw' images format). The filesize (with max upload size) will preserve of big image upload. Render the image inside a html image can be fixed with the size properties (which exist for this purpose...). I m against to add this to the current imagesize function, by default or add a new function, I do not care about additionnaloptionnal paramater. my 2 cts pierre -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Should I fix this?
At 20:56 12-1-2003, Pierre-Alain Joye wrote: The filesize (with max upload size) will preserve of big image upload. Render the image inside a html image can be fixed with the size properties (which exist for this purpose...). I m against to add this to the current imagesize function, by default or add a new function, I do not care about additionnaloptionnal paramater. Ehm - you took that preserve-quoting business a bit too serious, cause that's exactly what I said. Well - my opinion on whether this should be fixed, was less explicit, so if it wasn't clear - I also don't think, image size should be determined by reading through the entire image. php.generaland by the way, max_upload_size is probably not even relevant, since webserver may run other apps, which do allow large uploads, but any call to php's filesize() on $_FILE['tmp_name'], will give you the required logic./php.general With kind regards, Melvyn Sopacua ?php include(not_reflecting_employers_views.txt); ? -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Should I fix this?
Melvyn Sopacua wrote: I don't agree. An avatar, by nature, has a fixed _image_ size. If you allow variable avatar image sizes, then you still have the option to use that same getimagesize() to set the width and height attributes of the HTML IMG tag and the browser (any browser), will render that image, with the set values. If the image is larger, it will simply scale down proportinally and the fun for the 'malicious haxoreditor' is spoiled already. To tell you the truth, I never really thought about running getimagesize() to get width=x height=y when displaying the images. For some reason I always thought that I would be forced to save the width and height in the database (or somewhere else) in order to display the images with the width and height HTML properties. Man, do I feel like an idiot now. I tried messing with an image and using the method you described and it works great in IE and Mozilla. Opera still has problems though (latest 7.0 beta). It seems to disregard the HTML properties and relies solely on the width and height of the actual data blocks in the image. I'm telling you, for every day that passes, my hatred towards that sorry excuse for a browser grows stronger and stronger :-) IIC - your reference for disallowing uploaded images, should be filesize rather than imagesize and as described above, you can use the bug, to restrain any layout problems that arrise. Well, there's nothing worse than a browser-scaled image in my opinion. What should be validated and what should not be is up to the forum administrator (in my case anyway). Thanks for the heads up. I guess I will scrap the patch I just finished now. That is, unless someone is interested in the code. /Kennel -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Apache2Filter SAPI segfaults
What bison version are you using. I saw similar segfaults with 1.875. Downgrading to 1.75 or even to 1.28 fixes it for me. Edin - Original Message - From: Sebastian Bergmann [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, January 12, 2003 10:07 AM Subject: Re: [PHP-DEV] Apache2Filter SAPI segfaults Sebastian Bergmann wrote: [...] I get a segfault with the same backtrace for Apache 1.3. -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Should I fix this?
On Mon, 13 Jan 2003 00:49:43 +0100 Rickard Andersson [EMAIL PROTECTED] wrote: To tell you the truth, I never really thought about running getimagesize() to get width=x height=y when displaying the images. For some reason I always thought that I would be forced to save the width and height in the database (or somewhere else) in order to display the images with the width and height HTML properties. Man, do I feel like an idiot now. You do not have to feel like an idiot, I always specify the widthheight for the images. pierre -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Should I fix this?
Pierre-Alain Joye wrote: You do not have to feel like an idiot, I always specify the widthheight for the images. Well, since I had somehow forgotten that I could use getimagesize() with every image display, I do, but if it had been a question of using the database to save widthheight, I don't. /Kennel -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] php5 object model
Hey, ADT is the Abstract Data Type extension available on cvs.php.net, module name adt. I'm nearing an alpha, but have one outstanding issue. ADT itself provides both a functional and an object oriented interface. The following example shows the two ways you can use a stack. Functional -- ?php $stack = adt_stack_new(); for ($i = 0; $i 100; ++$i) { adt_stack_push($stack, $i); } var_dump(adt_stack_pop($stack)); adt_stack_free($stack); ? Object Oriented -- ?php $stack = new adt_stack(); for ($i = 0; $i 100; ++$i) { $stack-push($i); } var_dump($stack-pop()); $stack-destroy(); ? ADT works fine with Zend Engine version 1, however, when using Zend Engine 2, the code segfaults when registering a new object: zend_hash_apply_with_argument (ht=0x0, apply_func=0x81117a0 zval_update_constant, argument=0x0) at /home/sterling/work/os/php/php5/Zend/zend_hash.c:702 702 HASH_PROTECT_RECURSION(ht); (gdb) bt #0 zend_hash_apply_with_argument (ht=0x0, apply_func=0x81117a0 zval_update_constant, argument=0x0) at /home/sterling/work/os/php/php5/Zend/zend_hash.c:702 #1 0x081196fa in _object_and_properties_init (arg=0x402c3a8c, class_type=0x8171000, properties=0x0) at /home/sterling/work/os/php/php5/Zend/zend_API.c:588 #2 0x0811971b in _object_init_ex (arg=0x402c3a8c, class_type=0x8171000) at /home/sterling/work/os/php/php5/Zend/zend_API.c:610 #3 0x0806591c in adt_register_resource (tptr=0x81b67c0, le_id=15, r_id=0x402c2d2c, obj=0x402c3a8c, cp=0x8171000, id=0x81b67d0) at /home/sterling/work/os/php/php5/ext/adt/php_adt.c:127 #4 0x08067a5e in zif_adt_stack_new (ht=0, return_value=0x402c3aac, this_ptr=0x402c3a8c, return_value_used=0) at /home/sterling/work/os/php/php5/ext/adt/php_stack.c:53 #5 0x081276cc in zend_do_fcall_common_helper (execute_data=0xbfffd730, op_array=0x402c21ac) at /home/sterling/work/os/php/php5/Zend/zend_execute.c:2566 #6 0x0812426f in execute (op_array=0x402c21ac) at /home/sterling/work/os/php/php5/Zend/zend_execute.c:1218 #7 0x081188f3 in zend_execute_scripts (type=8, retval=0x0, file_count=3) at /home/sterling/work/os/php/php5/Zend/zend.c:996 #8 0x080f57e8 in php_execute_script (primary_file=0xba10) at /home/sterling/work/os/php/php5/main/main.c:1691 #9 0x0812c4ed in main (argc=2, argv=0xbaa4) at /home/sterling/work/os/php/php5/sapi/cli/php_cli.c:753 The relevant code relating to this segfault is: object_init_ex(obj, cp); where obj is the zval * returned by getThis(), and cp represents a zend_class_entry *, registered by the following code. INIT_CLASS_ENTRY(stack_class_entry, adt_stack, stack_class_functions); zend_register_internal_class(stack_class_entry TSRMLS_CC); and stack_class_entry is of type zend_class_entry. cp is therefore a pointer to the global stack_class_entry. I'm running the non-threadsafe version of php. How can I make this code run with PHP 5? -Sterling -- C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg. - Bjarne Stroustrup -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] [PATCH] fix for bug #21600
Attached is a patch for bug #21600. This problem is caused by unnecessary zval destruction performed when trying to assign a value that is originated from the same zval. Moriyoshi Index: Zend/zend_execute.c === RCS file: /repository/Zend/zend_execute.c,v retrieving revision 1.316.2.3 diff -u -r1.316.2.3 zend_execute.c --- Zend/zend_execute.c 31 Dec 2002 16:22:59 - 1.316.2.3 +++ Zend/zend_execute.c 13 Jan 2003 00:34:32 - @@ -265,27 +265,37 @@ variable_ptr_ptr = EG(uninitialized_zval_ptr); /* } else if (variable_ptr==EG(uninitialized_zval) || variable_ptr!=value_ptr) { */ } else if (variable_ptr_ptr != value_ptr_ptr) { - variable_ptr-refcount--; - if (variable_ptr-refcount==0) { - zendi_zval_dtor(*variable_ptr); - FREE_ZVAL(variable_ptr); - } + if (variable_ptr != value_ptr) { + variable_ptr-refcount--; + if (variable_ptr-refcount==0) { + zendi_zval_dtor(*variable_ptr); + FREE_ZVAL(variable_ptr); + } - if (!PZVAL_IS_REF(value_ptr)) { - /* break it away */ - value_ptr-refcount--; - if (value_ptr-refcount0) { - ALLOC_ZVAL(*value_ptr_ptr); - **value_ptr_ptr = *value_ptr; - value_ptr = *value_ptr_ptr; - zendi_zval_copy_ctor(*value_ptr); + if (!PZVAL_IS_REF(value_ptr)) { + /* break it away */ + value_ptr-refcount--; + if (value_ptr-refcount0) { + ALLOC_ZVAL(*value_ptr_ptr); + **value_ptr_ptr = *value_ptr; + value_ptr = *value_ptr_ptr; + zendi_zval_copy_ctor(*value_ptr); + } + value_ptr-refcount = 1; + value_ptr-is_ref = 1; + } + *variable_ptr_ptr = value_ptr; + value_ptr-refcount++; + } else { + if (value_ptr == EG(uninitialized_zval_ptr)) { + ALLOC_ZVAL(value_ptr); + value_ptr-type = IS_NULL; + value_ptr-refcount = 1; + value_ptr-is_ref = 1; + *variable_ptr_ptr = *value_ptr_ptr = value_ptr; + value_ptr-refcount++; } - value_ptr-refcount = 1; - value_ptr-is_ref = 1; } - - *variable_ptr_ptr = value_ptr; - value_ptr-refcount++; } else { if (variable_ptr-refcount1) { /* we need to break away */ SEPARATE_ZVAL(variable_ptr_ptr); -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DEV] Win32 crash (HEAD + ZE2)
Hi, This code works fine ?php $myvar = array(); ? But this does not: ?php include test.inc; ? where test.inc contains ?php $myvar = array(); ? It works with other data types and I have tested it in Linux where it works. Any ideas ? - Frank -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DEV] Apache2Filter SAPI segfaults
Edin Kadribasic wrote: What bison version are you using. I saw similar segfaults with 1.875. I was using 1.875. Downgrading to 1.75 or even to 1.28 fixes it for me. Downgrading to 1.75 worked for me, too. -- Sebastian Bergmann http://sebastian-bergmann.de/ http://phpOpenTracker.de/ Did I help you? Consider a gift: http://wishlist.sebastian-bergmann.de/ -- PHP Development Mailing List http://www.php.net/ To unsubscribe, visit: http://www.php.net/unsub.php