Eval() problem in PHP
<p>Quite some time ago I wrote a RSS parser. It worked fine until now, when I turned my error and notice reporting on. Currently I keep getting quite a lot of notices that tell me that something is wrong in the function. I tried solving this problem on my own, but I had no success. Could You please help me with this error?</p>

<p>The error:</p>

<pre><code>Notice: Undefined index: RSS in C:\xampp\htdocs\Dropbox\RECtus\System\sysFiles\libarys\myRSSParser.lib(103) : eval()'d code on line 1

Notice: Undefined index: LINK in C:\xampp\htdocs\Dropbox\RECtus\System\sysFiles\libarys\myRSSParser.lib(103) : eval()'d code on line 1
</code></pre>

<p>The script:</p>

<pre><code>function parseData($parser, $data) {
        if(!trim($data)) return;
        $RSS = '';
        $evalcode = "\$this-&gt;output";

        foreach($this-&gt;tags as $tag) {
            if(is_array($tag)) {
                list($tagname, $indexes) = each($tag);

                $evalcode .= "[\"$tagname\"]";
                if(!isset(${$tagname})) ${$tagname} = '';
                if(${$tagname}) $evalcode .= "[" . (${$tagname} - 1) . "]";
                if($indexes) extract($indexes); 
            } else {
                if(preg_match("/^([A-Z]+):([A-Z]+)$/", $tag, $matches)) {
                    $evalcode .= "[\"$matches[1]\"][\"$matches[2]\"]";
                } else {
                    $evalcode .= "[\"$tag\"]";
                }
            }
        }
        eval("$evalcode = $evalcode . '" . addslashes($data) . "';");
}
</code></pre>

<p>Line 103 is the eval() line.</p>
