From 3cec6b5fb94582a018dad1fec974fd3af9f75cb8 Mon Sep 17 00:00:00 2001 From: cosme12 Date: Tue, 7 Apr 2015 15:47:38 -0300 Subject: [PATCH] Building bugs This bug is a little hard to meet but It's still there. I found it by trying to use NPC merchant while not having a marketplace. It will show an error. The bug happens everytime you type ```build.php?id=5&t=2``` . The problem here is ```t=``` or ```s=```, both are used as tabs in certain buildings, but when it has only 1 page it crash. For example: market has " Send Resources | Buy | Offer | NPC trading " while clay pit has none. So adding the t= variable to the clay pit would make it display an error. This is probably not the best way to fix it but it works. Now, there is still another problem, marketplace has 4 tabs, so adding ```&t=5``` will bug it. It would be better if you can test it again, just in case I broke something :P --- build.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build.php b/build.php index c78ebe0c..911188b7 100644 --- a/build.php +++ b/build.php @@ -37,6 +37,11 @@ if(isset($_GET['id'])) { if (!ctype_digit(preg_replace("/[^a-zA-Z0-9_-]/","",$_GET['id']))){ $_GET['id'] = "1"; } + $checkBuildings = array(0,17,25,26,27); + if($_GET['id'] < 19 || !in_array($_GET['gid'], $checkBuildings)){ + $_GET['t'] = ""; + $_GET['s'] = ""; + } if($village->resarray['f'.$_GET['id'].'t'] == 17) { $market->procRemove($_GET); }