Merge pull request #5577 from claudiosmweb/improve-system-status-logs
Stop "no such file or directory" warnings
This commit is contained in:
commit
978268dfa6
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue