Update house.php (#359)

Fixed undefined index id when accessing house.php directly.
This commit is contained in:
gregorecruzeiro 2019-04-25 12:29:39 -03:00 committed by Stefan A. Brannfjell
parent d9cd81508b
commit 8404f8e171

View File

@ -3,7 +3,7 @@ if ($config['log_ip']) {
znote_visitor_insert_detailed_data(3); znote_visitor_insert_detailed_data(3);
} }
$house = getValue($_GET['id']); $house = (isset($_GET['id']) && (int)$_GET['id'] > 0) ? (int)$_GET['id'] : false;
if ($house !== false && $config['ServerEngine'] === 'TFS_10') { if ($house !== false && $config['ServerEngine'] === 'TFS_10') {
$house = mysql_select_single("SELECT `id`, `owner`, `paid`, `name`, `rent`, `town_id`, `size`, `beds`, `bid`, `bid_end`, `last_bid`, `highest_bidder` FROM `houses` WHERE `id`='$house';"); $house = mysql_select_single("SELECT `id`, `owner`, `paid`, `name`, `rent`, `town_id`, `size`, `beds`, `bid`, `bid_end`, `last_bid`, `highest_bidder` FROM `houses` WHERE `id`='$house';");
@ -149,4 +149,4 @@ if ($house !== false && $config['ServerEngine'] === 'TFS_10') {
<p>Go back to the <a href="houses.php">house list</a> and select a house for further details.</p> <p>Go back to the <a href="houses.php">house list</a> and select a house for further details.</p>
<?php <?php
} }
include 'layout/overall/footer.php'; ?> include 'layout/overall/footer.php'; ?>