[ Поиск ] - [ Пользователи ] - [ Календарь ]
Полная Версия: eval после перевода на 5.3
karakas
Добрый день, собственно есть огромное количество регулярных выражений в файле и в двух местах используется eval. После перевода хостинга на php 5.3 стала появляться ошибка при использовании одного из них.
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 лет и его писал не я :(
Есть идеи какие-нить?)
Быстрый ответ:

 Графические смайлики |  Показывать подпись
Здесь расположена полная версия этой страницы.
Invision Power Board © 2001-2024 Invision Power Services, Inc.