From 0a50efb4f113b67dbf88d246c039f990e741c7ac Mon Sep 17 00:00:00 2001 From: Denis Ovsienko Date: Fri, 5 Jun 2009 14:36:24 +0000 Subject: [PATCH 1/1] r2828 - fixContext(): check return value of spotEntity() (ticket:51) --- ChangeLog | 2 ++ inc/functions.php | 14 +++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7c85d195..41cf8776 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ +0.17.2 + update: show appropriate message, if a record cannot be found 0.17.1 2009-06-03 bugfix: tags were not displayed on "File" page bugfix: multiline comment for an added file was stored incorrectly diff --git a/inc/functions.php b/inc/functions.php index b29f64d5..045c0ace 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1098,7 +1098,19 @@ function fixContext () { // Each page listed in the map above requires one uint argument. assertUIntArg ($page[$pageno]['bypass'], __FUNCTION__); - $target = spotEntity ($etype_by_pageno[$pageno], $_REQUEST[$page[$pageno]['bypass']]); + $target_realm = $etype_by_pageno[$pageno]; + $target_id = $_REQUEST[$page[$pageno]['bypass']]; + if (NULL === ($target = spotEntity ($target_realm, $target_id))) + { + showError + ( + "The record you are requesting isn't in the database (any more)\n" . + "realm: '${target_realm}'\n" . + "id: '${target_id}'", + __FUNCTION__ + ); + die; + } $target_given_tags = $target['etags']; // Don't reset autochain, because auth procedures could push stuff there in. // Another important point is to ignore 'user' realm, so we don't infuse effective -- 2.25.1