From dfdd7698c34644ce8c43b59df59bd9d81e10c7a0 Mon Sep 17 00:00:00 2001 From: botanic Date: Tue, 9 Sep 2014 17:20:23 -0700 Subject: [PATCH] fix windows warnings in sync --- code/web/private_php/ams/autoload/sync.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/web/private_php/ams/autoload/sync.php b/code/web/private_php/ams/autoload/sync.php index fac64be0d..1160b91b5 100644 --- a/code/web/private_php/ams/autoload/sync.php +++ b/code/web/private_php/ams/autoload/sync.php @@ -106,14 +106,14 @@ class Sync{ if ($OS == 2) { $processes = explode( "\n", shell_exec( "tasklist.exe" )); - foreach( $processes as $process ) + foreach( $processes as $key => $value ) { - if( strpos( "Image Name", $process ) === 0 - || strpos( "===", $process ) === 0 ) + if( empty($value) != '1' && strpos( "Image Name", $value ) === 0 + || empty($value) != '1' && strpos( "===", $value ) === 0 ) continue; $matches = false; - preg_match( "/(.*?)\s+(\d+).*$/", $process, $matches ); - if ($pid = $matches[ 2 ]) { + preg_match( "/(.*?)\s+(\d+).*$/", $value, $matches ); + if (isset($matches[ 2 ]) && $pid = $matches[ 2 ]) { return true; } }