For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > January 2006 > #36198 [Opn->Fbk]: Not understandible ereg()-warning "Invalid preceding regul









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #36198 [Opn->Fbk]: Not understandible ereg()-warning "Invalid preceding regul
derick@php.net

2006-01-29, 7:55 am

ID: 36198
Updated by: derick@php.net
Reported By: thomas at pixtur dot de
-Status: Open
+Status: Feedback
Bug Type: Documentation problem
Operating System: Debian Server
PHP Version: Irrelevant
New Comment:

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

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external
resources such as databases, etc.

If possible, make the script source available online and provide
an URL to it here. Try to avoid embedding huge scripts into the report.


Previous Comments:
------------------------------------------------------------------------

[2006-01-29 12:37:42] thomas at pixtur dot de

Description:
------------
The warning only occurs on very few plattforms. I probably could fix it
in my code, if I could only understand it's meaning. If you google for
the error-message you will find tons of broken pages with the same
error but no explanation.




Reproduce code:
---------------
/* NOT reproducable */
class ListBlockColHtml extends ListBlockCol
{
function render_tr(&$obj, $style="") {
if(!isset($obj) || !is_object($obj)) {
trigger_error("ListBlockColHtml->render_tr() called without valid
object",E_USER_WARNING);
return;
}
$key= $this->key;
$format= $this->format;
$rest=$this->format;
$style= $this->style
? "class='$this->style'"
: '';

while( ereg("{\?([a-z_]*)}(.*)",$rest, $matches) ) { ### causes
error
$key=$matches[1];
$rest=$matches[2];
$value= isset($obj->$key) ? $obj->$key : "??$key";
$format=ereg_replace("{\?$key}",$value,$format);
}
print "<td $style>$format</td>";
}
}



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


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







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com