Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2020-12-11 11:01:33 +0300
committerGitHub <noreply@github.com>2020-12-11 11:01:33 +0300
commit6c8c11821562a05e404ee5588e26074024d79729 (patch)
treefe95acfcb4df228ff8ef10753af8bae0485d1946 /core
parentd8517139c10af849d105e91dfea878a907c3ff7f (diff)
Better check for getmypid to potentially avoid warnings (#16936)
refs https://wordpress.org/support/topic/warning-getmypid-has-been-disabled/ Might not make a difference but could (because third parameter in in_array is not true). This way we might better detect that getmypid is not supported although in the user's case likely the problem is that `getmypid` is supported in web and not CLI.
Diffstat (limited to 'core')
-rw-r--r--core/CliMulti/Process.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/core/CliMulti/Process.php b/core/CliMulti/Process.php
index 7348e8ce6a..daed5a85c4 100644
--- a/core/CliMulti/Process.php
+++ b/core/CliMulti/Process.php
@@ -181,7 +181,8 @@ class Process
return false;
}
- if (!in_array(getmypid(), self::getRunningProcesses())) {
+ $pid = @getmypid();
+ if (empty($pid) || !in_array($pid, self::getRunningProcesses())) {
return false;
}