PluginProbe
Booking Calendar / 11.8.3
Booking Calendar v11.8.3
11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 10.11.2 All 203 releases
← All changes | js/captcha/captcha.php +10 -1 10.1111.8.3 View file →
@@ -8,8 +8,12 @@
8 8 Text Domain: really-simple-captcha
9 9 Version: 1.9
10 10 */
11 11
12 +if ( ! defined( 'ABSPATH' ) ) {
13 + exit; // Exit if accessed directly.
14 +}
15 +
12 16 /* Copyright 2007-2016 Takayuki Miyoshi (email: takayukister at gmail.com)
13 17
14 18 This program is free software; you can redistribute it and/or modify
15 19 it under the terms of the GNU General Public License as published by
@@ -284,8 +288,13 @@
284 288
285 289 $file = $this->normalize_path( $dir . $filename );
286 290
287 291 $stat = @stat( $file );
292 + if ( false === $stat || ! isset( $stat['mtime'] ) ) {
293 + // A concurrent CAPTCHA cleanup can remove the file after readdir().
294 + continue;
295 + }
296 +
288 297 if ( ( $stat['mtime'] + $minutes * 60 ) < time() ) {
289 298 // phpcs:ignore WordPress.WP.AlternativeFunctions.unlink_unlink
290 299 if ( ! @wp_delete_file( $file ) ) {
291 300 // phpcs:ignore WordPress.WP.AlternativeFunctions.file_system_operations_chmod
@@ -420,5 +429,5 @@
420 429 $path = str_replace( '\\', '/', $path );
421 430 $path = preg_replace( '|/+|', '/', $path );
422 431 return $path;
423 432 }
424 -}
433 +}