We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d01aa16 commit 77006bdCopy full SHA for 77006bd
browscap/Browscap.php
@@ -192,7 +192,14 @@ public function __construct($cache_dir)
192
);
193
}
194
195
- $cache_dir = realpath($cache_dir);
+ $old_cache_dir = $cache_dir;
196
+ $cache_dir = realpath($cache_dir);
197
+
198
+ if (false === $cache_dir) {
199
+ throw new Browscap_Exception(
200
+ sprintf('The cache path %s is invalid. Are you sure that it exists and that you have permission to access it?', $old_cache_dir)
201
+ );
202
+ }
203
204
// Is the cache dir really the directory or is it directly the file?
205
if (substr($cache_dir, -4) === '.php') {
0 commit comments