Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue with get_component
#1
Was getting an error of <? displaying when i used components.

I adjusted to:

Code:
function get_component($id) {
        if (file_exists('data/other/components.xml')) {
            $thisfile = file_get_contents("data/other/components.xml");
            $data = simplexml_load_string($thisfile, NULL, LIBXML_NOCDATA);
            $components = $data->item;
            
            if (count($components) != 0) {
                foreach ($components as $component) {
                    if ($id == $component->slug) {
                        eval("?>" . stripslashes(htmlspecialchars_decode($component->value, ENT_QUOTES)));
                    }
                }
            }
        }

Remove an extra ?> at the end of the eval line, fixed it up. Can you let me know if this is a security issue or the correct method to fix the issue?
Nothing is too difficult... anything is possible.
'But you tried, and you failed.. the important thing? never try'
Reply


Messages In This Thread
Issue with get_component - by crashfellow - 2009-09-04, 01:31:41
Issue with get_component - by ccagle8 - 2009-09-05, 11:43:36
Issue with get_component - by crashfellow - 2009-09-06, 11:55:48



Users browsing this thread: 1 Guest(s)