PDA

View Full Version : Can offer negative money on trades


tittlemouse
03-24-2011, 10:03 AM
I tested this out on this site
http://dragonsfarm.host56.com/

It is using the latest version of the Mysidia script
You can send someone a offer of a pet for -999999999 from the trades page. The person accepting loses the money.

I made 2 accounts 1 named tittlemouse the other named avfctom
I send a offer of -999999999 tittlemouse from avfctom and accepted it and I got this.

On tittlemouse
You have -999996999 Dragon Yen.

Your links:
ADOPT NEW PETS
ACQUIRE POUNDED PETS
MANAGE ADOPTABLES

fadillzzz
03-24-2011, 10:08 AM
Seems like people always forgot to filter the (-) minus sign.
Anyway, I think this should fix the problem.
Open your trade.php
find this code

$adoptwanted = $_POST["adoptwanted"];
$adoptgiven = $_POST["adoptgiven"];
$cashgiven = $_POST["cashgiven"];
$message = $_POST["message"];

Just below that, add

$cashgiven = abs($cashgiven);

Hall of Famer
03-24-2011, 10:09 AM
umm I see, add this line after if($cashenabled == "yes")[


$cashgiven = abs($cashgiven);
Lemme know if it solves your problem or not.

@Fadillzzz: Another possible way to fix this issue is to generate an error message when negative amount is entered.

tittlemouse
03-24-2011, 10:11 AM
I don't know since that is not my site buy hopefully the owner of it will log on later and be able to see if that works.

fadillzzz
03-24-2011, 10:23 AM
@HoF
Yeah. That should works too.

RoconzaArt
03-24-2011, 10:27 AM
How do i fix this for mytrades.php too? Is it the same way?

fadillzzz
03-24-2011, 10:31 AM
For mytrades.php
After this

$tid = $_POST["tid"];
$petoffered = $_POST["petoffered"];
$tradewith = $_POST["tradewith"];
$petrequested = $_POST["petrequested"];
$moneyoffered = $_POST["moneyoffered"];
$trademessage = $_POST["trademessage"];

Add

$moneyoffered = abs($moneyoffered);

RoconzaArt
03-24-2011, 10:34 AM
Ok I'll try testing it.