Plugin Directory

Changeset 3250657


Ignore:
Timestamp:
03/04/2025 07:47:59 PM (12 months ago)
Author:
bitslip6
Message:

add stat to ensure cpuinfo is readable

Location:
bitfire/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • bitfire/trunk/data/bad-agent.txt

    r3188288 r3250657  
    4444sfish
    4545gaaaaa
     46{jndi
  • bitfire/trunk/src/api.php

    r3250587 r3250657  
    17001700   
    17011701    $cpu = 1;
    1702     $raw = file_get_contents('/proc/cpuinfo');
    1703     if (preg_match('/cpu cores\s+:\s+(\d+)/ims', $raw, $tmp)) {
    1704         $cpu = $tmp[1];
     1702    if (file_exists("/proc/cpuinfo") && is_readable("/proc/cpuinfo")) {
     1703        $raw = file_get_contents('/proc/cpuinfo');
     1704        if (preg_match('/cpu cores\s+:\s+(\d+)/ims', $raw, $tmp)) {
     1705            $cpu = $tmp[1];
     1706        }
    17051707    }
    17061708
Note: See TracChangeset for help on using the changeset viewer.