BUGFIX: SMFShop File Download Hack

My current setup is SMF 2.0 RC4 and SMFShop by Createaforum.com plugin

Problem
One of our downloadable item is not working because $smcFunc variable is not present in filedownload.php file from SMFShop.

Solution
Modify the code to fix the bug.

BEFORE:

$smcFunc['db_query'](”, ‘
DELETE FROM {db_prefix}shop_inventory
WHERE id = {int:id}’,
array(
‘id’ => $_GET['id'],
));

AFTER:

$id = $_GET['id'];
mysql_query(“DELETE FROM smf_shop_inventory WHERE id = $id”);

Result
Item can now be downloaded and the purchased item is also deleted. Case closed.

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Palitan )

Twitter picture

You are commenting using your Twitter account. Log Out / Palitan )

Facebook photo

You are commenting using your Facebook account. Log Out / Palitan )

Connecting to %s