Parse error: syntax error, unexpected '{' in /home/sarushen/public_html/lib/class_datafile.php(436) : eval()'d code on line 1
Сама функция:
function formatRecord($index)
{
$result = "";
if (($index >= 0) && ($index < $this->row_count))
{
$i = $index;
eval($this->format_expression);
return $row_str;
}
else
return "";
}
Если распечатать то, что передается в eval
echo $this->format_expression;
То увидим на странице будет выведено:
$row_str = ($this->headers[0][$i] == 3) ? (preg_replace(array("/\{\#\}/", "/\{\&\}/", "/\{\*\}/", "/\{id\}/", "/\{\^id\}/", "/\{question\}/", "/\{\^question\}/"), array($i, $this->current, $this->row_count, $this->headers[0][$i], strtoupper($this->headers[0][$i]), $this->headers[4][$i], strtoupper($this->headers[4][$i])), "")) : ("");$row_str = ($this->headers[0][$i] == 3) ? (preg_replace(array("/\{\#\}/", "/\{\&\}/", "/\{\*\}/", "/\{id\}/", "/\{\^id\}/", "/\{question\}/", "/\{\^question\}/"), array($i, $this->current, $this->row_count, $this->headers[0][$i], strtoupper($this->headers[0][$i]), $this->headers[4][$i], strtoupper($this->headers[4][$i])), "")) : ("");$row_str = ($this->headers[0][$i] == 3) ? (preg_replace(array("/\{\#\}/", "/\{\&\}/", "/\{\*\}/", "/\{id\}/", "/\{\^id\}/", "/\{question\}/", "/\{\^question\}/"), array($i, $this->current, $this->row_count, $this->headers[0][$i], strtoupper($this->headers[0][$i]), $this->headers[4][$i], strtoupper($this->headers[4][$i])), "")) : ("");$row_str = ($this->headers[0][$i] == 3) ? (preg_replace(array("/\{\#\}/", "/\{\&\}/", "/\{\*\}/", "/\{id\}/", "/\{\^id\}/", "/\{question\}/", "/\{\^question\}/"), array($i, $this->current, $this->row_count, $this->headers[0][$i], strtoupper($this->headers[0][$i]), $this->headers[4][$i], strtoupper($this->headers[4][$i])), "")) : ("");$row_str = ($this->headers[0][$i] == 3) ? (preg_replace(array("/\{\#\}/", "/\{\&\}/", "/\{\*\}/", "/\{id\}/", "/\{\^id\}/", "/\{question\}/", "/\{\^question\}/"), array($i, $this->current, $this->row_count, $this->headers[0][$i], strtoupper($this->headers[0][$i]), $this->headers[4][$i], strtoupper($this->headers[4][$i])), "")) : ("");
Parse error: syntax error, unexpected '{' in /home/sarushen/public_html/lib/class_datafile.php(436) : eval()'d code on line 1
$row_str = ({poll_id} == 3) ? (preg_replace(array("/\{\#\}/", "/\{\&\}/", "/\{\*\}/"), array($i, $this->current, $this->row_count), "")) : ("");
Parse error: syntax error, unexpected '{' in /home/sarushen/public_html/lib/class_datafile.php(436) : eval()'d code on line 1
$row_str = ({poll_id} == 3) ? (preg_replace(array("/\{\#\}/", "/\{\&\}/", "/\{\*\}/"), array($i, $this->current, $this->row_count), "")) : ("");
Parse error: syntax error, unexpected '{' in /home/sarushen/public_html/lib/class_datafile.php(436) : eval()'d code on line 1
$row_str = ({poll_id} == 3) ? (preg_replace(array("/\{\#\}/", "/\{\&\}/", "/\{\*\}/"), array($i, $this->current, $this->row_count), "")) : ("");
Parse error: syntax error, unexpected '{' in /home/sarushen/public_html/lib/class_datafile.php(436) : eval()'d code on line 1
$row_str = ({poll_id} == 3) ? (preg_replace(array("/\{\#\}/", "/\{\&\}/", "/\{\*\}/"), array($i, $this->current, $this->row_count), "")) : ("");
Сайту уже около 7 лет и его писал не я :(
Есть идеи какие-нить?)