Fixed the parameter substitution. Will now take parameters named either 'p1' or 'p_1'.

This commit is contained in:
skeeter 2002-01-12 22:12:40 +00:00
parent 8bc7d387ce
commit 27e9b9af70
2 changed files with 18 additions and 2 deletions

View File

@ -48,7 +48,15 @@
$str = 'p_'.$counter;
if(isset($parms[$str]) && !empty($parms[$str]))
{
$parray[] = $parms[$str];
$parray[$counter] = $parms[$str];
}
else
{
$str = 'p'.$counter;
if(isset($parms[$str]) && !empty($parms[$str]))
{
$parray[$counter] = $parms[$str];
}
}
}
$fname = $parms['file'];
@ -63,6 +71,14 @@
{
$this->msg = trim($etext);
}
@reset($parray);
while( list($key,$val) = each( $parray ) )
{
$this->msg = preg_replace( "/%$key/", "'".$val."'", $this->msg );
}
@reset($parray);
$this->timestamp = time();
$this->parms = $parray;
$this->ismsg = $parms['ismsg'];

View File

@ -134,7 +134,7 @@
."', '". $err->severity . "'"
.", '". $err->code . "'"
.", '". $db->db_addslashes($err->msg) . "'"
.", '". $db->db_addslashes(implode('|',$err->parms)). "'"
.", '". $db->db_addslashes((count($err->parms) > 1?implode('|',$err->parms):$err->parms[1])). "'"
.", '". $err->fname . "'"
.", " . intval($err->line)
.")"