line 1 of emfield.module(461) : eval()'d code.

Makes this harder to debug. Error is in the emfield_request_xml function.

Got this while running update.php

      if ($xml_elem['type'] == 'complete') {
        $php_stmt = '$response';
        while ($start_level < $xml_elem['level']) {
          $php_stmt .= '[$level['. $start_level .']]';
          $start_level++;
        }
        $php_stmt .= '[$xml_elem[\'tag\']][] = $xml_elem[\'value\'];'. $php_stmt .'[$xml_elem[\'tag\']][] = $xml_elem[\'attributes\'];';
        eval($php_stmt);
        $start_level--;
      }

My question is why do we need an eval here??? It seems unnecessary. This is the code that eval is running

$response[$level[2]][$xml_elem['tag']][] = $xml_elem['value'];
$response[$level[2]][$xml_elem['tag']][] = $xml_elem['attributes'];
CommentFileSizeAuthor
#2 emfield-1155902-2.patch731 bytesmikeytown2

Comments

mikeytown2’s picture

Title: Undefined index: value in eval(). No need to use eval here. » Undefined index: value in eval(). No need to use eval here.
Issue tags: +Performance

This is what I have running through eval. I had over 250 pages of watchdog reporting what was getting eval-ed while running update.php. This is a major performance issue.

$response[$xml_elem['tag']][] = $xml_elem['value'];
$response[$xml_elem['tag']][] = $xml_elem['attributes'];
$response[$level[1]][$level[2]][$xml_elem['tag']][] = $xml_elem['value'];
$response[$level[1]][$level[2]][$xml_elem['tag']][] = $xml_elem['attributes'];
$response[$level[1]][$xml_elem['tag']][] = $xml_elem['value'];
$response[$level[1]][$xml_elem['tag']][] = $xml_elem['attributes'];
$response[$level[2]][$xml_elem['tag']][] = $xml_elem['value'];
$response[$level[2]][$xml_elem['tag']][] = $xml_elem['attributes'];

Going to read up on http://php.net/variables.variable

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new731 bytes

Tested and it give the same output as the old way.