Skip to content

Commit 7dbfff4

Browse files
committed
Handle missing errors from file_get_contents
1 parent a84360a commit 7dbfff4

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/OriginDetection.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,14 @@ public function parseCgroupNodePath($lines)
6363

6464
public function getCgroupInode($cgroupMountPath, $procSelfCgroupPath)
6565
{
66-
if (!is_readable($procSelfCgroupPath)) {
66+
// phpcs:disable
67+
$content = @file_get_contents($procSelfCgroupPath);
68+
// phpcs:enable
69+
if ($content == false) {
6770
return '';
6871
}
6972

70-
$cgroupControllersPaths = $this->parseCgroupNodePath(file_get_contents($procSelfCgroupPath));
73+
$cgroupControllersPaths = $this->parseCgroupNodePath($content);
7174

7275
foreach ([self::CGROUPV1BASECONTROLLER , ''] as $controller) {
7376
if (!isset($cgroupControllersPaths[$controller])) {

0 commit comments

Comments
 (0)