From 1bb6c3bc23d08851f6af786f516b3cbc73a6f391 Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Mon, 11 May 2015 14:54:29 +0200 Subject: Check for wrong ids --- products.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'products.php') diff --git a/products.php b/products.php index b8391d9..1591799 100644 --- a/products.php +++ b/products.php @@ -9,7 +9,11 @@ else } require_once('vendor.inc.php'); -$category = CategoryQuery::create()->filterById($id)->findOne(); +$category = CategoryQuery::create()->findOneById($id); +if ( !is_object($category) ) +{ + header('Location: categories.php'); +} $products = $category->getProducts(); ?> @@ -33,7 +37,7 @@ $products = $category->getProducts();
getId()}\">{$product->getName()}"; + echo "
getId()}&catid={$id}\">{$product->getName()}
"; echo "
{$product->getDescription()}
"; } ?> -- cgit v1.2.3-70-g09d2