Home » HTML » HTML_QuickForm » Bug #5097
PHP crashes when throwing an exception after a form is created
Details
| Submitted | 2005-08-15 10:50 UTC |
|---|---|
| From | steven11 at gmx dot de |
| Status | Bogus |
| Package | HTML_QuickForm |
| PHP Version | 5.0.3 |
| OS | Windows |
| Roadmaps | (Not assigned) |
Comments
[2005-08-15 10:50 UTC] steven11 at gmx dot de
Description:
------------
Hi,
under certain circumstances the whole PHP-process crashes when throwing an exception after a form is created. It happens when a submit-Button is added to the form (maybe it also happens when other controls are added, but I didn't test this).
Also necessary is a call to call_user_method(). See the simplified code sample to get the idea ;-)
mfg Steven
Test script:
---------------
abstract class AbstractEditor {
public function doUploadIt() {
call_user_method('doUpload', $this);
}
}
class Editor extends AbstractEditor {
public function doUpload() {
$form = new HTML_QuickForm('frm');
$form->addElement('submit', 'submit', 'OK');
throw new Exception("test-exception");
}
}
try {
$edit = new Editor();
$edit->doUploadIt();
}
catch (Exception $err) {
die($err->getMessage());
}
Expected result:
----------------
The expected result is this output:
test-exception
Actual result:
--------------
No output, PHP crashes with an Access Violation (wants to access address 0x00000000)
[2005-08-15 10:56 UTC] steven11 at gmx dot de
I forgot something:
at the end of the code there must be two echo-calls:
echo "something";
echo "something";