com web/php: Check if the file exists before trying to open it: include/manual-lookup.inc

From: Date: Wed, 06 Jul 2011 11:25:28 +0000
Subject: com web/php: Check if the file exists before trying to open it: include/manual-lookup.inc
Groups: php.webmaster 
Request: Send a blank email to php-webmaster+get-23509@lists.php.net to get a copy of this message
Commit: 4cbf64cf9becf959bac8d4a2a06b8e16c1fc0c2d Author: Hannes Magnusson <bjori@php.net> Wed, 6 Jul 2011 11:25:28 +0000 Parents: a6b6d961024ed7d1d15cc3a01d26403ce987e620 Branches: master Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=4cbf64cf9becf959bac8d4a2a06b8e16c1fc0c2d Log: Check if the file exists before trying to open it Changed paths: M include/manual-lookup.inc Diff: diff --git a/include/manual-lookup.inc b/include/manual-lookup.inc index 2d0d150..45abed7 100644 --- a/include/manual-lookup.inc +++ b/include/manual-lookup.inc @@ -88,6 +88,7 @@ function find_manual_page($lang, $keyword) // open rather than popen to avoid any chance of confusion // when rsync updates the database if (!function_exists("sqlite_open") || + !file_exists($_SERVER['DOCUMENT_ROOT'] . '/backend/manual-lookup.sqlite') || !($s = @sqlite_open($_SERVER['DOCUMENT_ROOT'] . '/backend/manual-lookup.sqlite'))) { return find_manual_page_slow($lang, $keyword); }

« previous php.webmaster (#23509) next »