Merge pull request #5577 from claudiosmweb/improve-system-status-logs

Stop "no such file or directory" warnings
This commit is contained in:
Mike Jolley 2014-05-28 19:32:39 +01:00
commit 978268dfa6
1 changed files with 4 additions and 4 deletions

View File

@ -280,11 +280,11 @@ class WC_Admin_Status {
* @return array * @return array
*/ */
public function scan_log_files() { public function scan_log_files() {
$files = scandir( WC_LOG_DIR ); $files = @scandir( WC_LOG_DIR );
$result = array(); $result = array();
if ( $files ) { if ( $files ) {
foreach ( $files as $key => $value ) { foreach ( $files as $key => $value ) {
if ( ! in_array( $value, array( ".",".." ) ) ) { if ( ! in_array( $value, array( '.', '..' ) ) ) {
if ( ! is_dir( $value ) && strstr( $value, '.log' ) ) { if ( ! is_dir( $value ) && strstr( $value, '.log' ) ) {
$result[ sanitize_title( $value ) ] = $value; $result[ sanitize_title( $value ) ] = $value;
} }