PluginProbe
Defender Security – Malware Scanner, Login Security & Firewall / 6.3.0
Defender Security – Malware Scanner, Login Security & Firewall v6.3.0
6.3.0 6.2.3 6.2.4 6.2.0 6.2.1 6.2.2 6.1.0 5.3.1 5.4.0 5.4.1 5.5.0 5.5.1 5.6.0 5.6.1 5.6.2 5.7.0 5.7.1 5.7.2 5.8.0 5.8.1 5.9.0 6.0.0 6.0.1 3.0.1 3.1.0 All 141 releases
← All changes | framework/base/class-file.php +8 -7 5.7.1 → 6.3.0 View file →
@@ -158,9 +158,9 @@
158 158 $directory_flag = FilesystemIterator::KEY_AS_PATHNAME | FilesystemIterator::CURRENT_AS_FILEINFO
159 159 | FilesystemIterator::UNIX_PATHS | FilesystemIterator::SKIP_DOTS;
160 160 $directory = new RecursiveDirectoryIterator( $path, $directory_flag );
161 161
162 - if ( ! empty( $this->include ) || ! empty( $this->exclude ) ) {
162 + if ( array() !== $this->include || array() !== $this->exclude ) {
163 163 $directory = new RecursiveCallbackFilterIterator(
164 164 $directory,
165 165 array(
166 166 &$this,
@@ -184,9 +184,9 @@
184 184 continue;
185 185 }
186 186 if ( false === $this->is_recursive ) {
187 187 // Have to filter this, for un recursive.
188 - if ( ! empty( $this->include ) || ! empty( $this->exclude ) ) {
188 + if ( array() !== $this->include || array() !== $this->exclude ) {
189 189 if ( false === $this->filter_directory( $real_path ) ) {
190 190 continue;
191 191 }
192 192 }
@@ -246,9 +246,9 @@
246 246 if ( 'dir' === $type ) {
247 247 $real_path .= DIRECTORY_SEPARATOR;
248 248 }
249 249
250 - if ( ( ! empty( $this->include ) || ! empty( $this->exclude ) ) && ( false === $this->filter_directory(
250 + if ( ( array() !== $this->include || array() !== $this->exclude ) && ( false === $this->filter_directory(
251 251 $real_path,
252 252 $type
253 253 ) ) ) {
254 254 continue;
@@ -307,9 +307,9 @@
307 307 // Hidden files, move on.
308 308 continue;
309 309 }
310 310
311 - if ( ( ! empty( $this->include ) || ! empty( $this->exclude ) ) && ( false === $this->filter_directory( $real_path ) ) ) {
311 + if ( ( array() !== $this->include || array() !== $this->exclude ) && ( false === $this->filter_directory( $real_path ) ) ) {
312 312 continue;
313 313 }
314 314
315 315 $type = filetype( $real_path );
@@ -352,11 +352,11 @@
352 352 *
353 353 * @return bool|void
354 354 */
355 355 public function filter_directory( $current, $filetype = null ) {
356 - if ( ! empty( $this->include ) ) {
356 + if ( array() !== $this->include ) {
357 357 return $this->filter_include( $current, $filetype );
358 - } elseif ( ! empty( $this->exclude ) ) {
358 + } elseif ( array() !== $this->exclude ) {
359 359 return $this->filter_exclude( $current, $filetype );
360 360 }
361 361 }
362 362
@@ -416,9 +416,10 @@
416 416 // Now filename.
417 417 $filename_include = isset( $include['filename'] ) ? $include['filename'] : array();
418 418 if ( is_array( $filename_include ) && count( $filename_include ) && 'file' === $type ) {
419 419 foreach ( $filename_include as $filename ) {
420 - if ( preg_match( '/' . $filename . '/', pathinfo( $path, PATHINFO_BASENAME ) ) ) {
420 + $pattern = '/' . preg_quote( $filename, '/' ) . '/';
421 + if ( preg_match( $pattern, pathinfo( $path, PATHINFO_BASENAME ) ) ) {
421 422 return true;
422 423 }
423 424 }
424 425 ++$applied;