com web/php: Ensure we have a statement object, otherwise show a 'service not available' page: include/manual-lookup.inc
| From: | Paul Dragoonis | Date: | Wed, 06 Jul 2011 14:15:01 +0000 |
| Subject: | com web/php: Ensure we have a statement object, otherwise show a 'service not available' page: include/manual-lookup.inc | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-23505@lists.php.net to get a copy of this message | ||
Commit: 03443fa25e1f54d3576f740b9920c6fea7bef683
Author: Hannes Magnusson <bjori@php.net> Wed, 6 Jul 2011 14:15:01 +0000
Parents: bef02edee87ffb6daa2b4c1de923d843b14b822e
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=03443fa25e1f54d3576f740b9920c6fea7bef683
Log:
Ensure we have a statement object, otherwise show a 'service not available' page
Changed paths:
M include/manual-lookup.inc
Diff:
diff --git a/include/manual-lookup.inc b/include/manual-lookup.inc
index a182f28..f451f38 100644
--- a/include/manual-lookup.inc
+++ b/include/manual-lookup.inc
@@ -144,7 +144,9 @@ function find_manual_page($lang, $keyword)
AND keyword IN (?, ?, ?, ?) ORDER BY keyword = ? DESC, prio LIMIT 1";
$stm = $dbh->prepare($SQL);
- $stm->execute(array($lang, $keyword, str_replace(' ', '',
$keyword), str_replace(' ', '-', $keyword), str_replace('-',
'', $keyword), $keyword));
+ if ($stm) {
+ $stm->execute(array($lang, $keyword, str_replace(' ', '',
$keyword), str_replace(' ', '-', $keyword), str_replace('-',
'', $keyword), $keyword));
+ }
}
// Successful query