Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do I find the contents of $this->getAbsoluteFooter() Magento

Tags:

magento

I'm struggling to find what this calls '$this->getAbsoluteFooter()' or where it's contents are. Is it a template file?

The reason I ask is because my site was hacked with a js injection in the footer. Disabling $this->getAbsoluteFooter() removed the injection so I'm anxious to find the source.

I've Googled it and the only thing I can find is someone asking the same question.

Thanks.

like image 839
Gerry Avatar asked Oct 16 '15 23:10

Gerry


1 Answers

You've been hacked which means this could be anywhere, so keep that in mind when this doesn't work for you.

The getAbsoluteFooter method is normally defined in the following file.

#File: app/code/core/Mage/Page/Block/Html.php
public function getAbsoluteFooter()
{
    return Mage::getStoreConfig('design/footer/absolute_footer');
}

In a normal system, the getStoreConfig method will return the value stored in core_config_data for the passed in path (design/footer/absolute_footer).

Of course, since you're hacked, the actual class file $this refers to in your template could be anywhere on the server (depending on the severity of your hack). Give the following a try to find the real file on your specific system

//$this->getAbsoluteFooter();
$r = new ReflectionClass($this);
var_dump($r->getFilename());

That should reveal the actual filename, which may be app/code/core/Mage/Page/Block/Html.php, or may be something else.

Good luck!

like image 129
Alan Storm Avatar answered Oct 05 '22 23:10

Alan Storm