Changeset 1273

Show
Ignore:
Timestamp:
11/07/07 20:54:19 (1 year ago)
Author:
rho
Message:

fix #136, annoying warnings when is enabled open_basedir or disabled url fopen

Sign-off-by: Rolando Espinoza La Fuente

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/lib/elgglib.php

    r1264 r1273  
    12661266    // /proc will only work under some linux configurations 
    12671267    // while uptime is there under MacOSX/Darwin and other unices 
    1268     if (is_readable('/proc/loadavg') && $loadavg = @file('/proc/loadavg')) { 
     1268    if (!ini_get('open_basedir') && is_readable('/proc/loadavg') && $loadavg = @file('/proc/loadavg')) { 
    12691269        list($server_load) = explode(' ', $loadavg[0]); 
    12701270        unset($loadavg); 
    1271     } else if ( function_exists('is_executable') && is_executable('/usr/bin/uptime') && $loadavg = `/usr/bin/uptime` ) { 
     1271    } else if (!ini_get('open_basedir') && function_exists('is_executable') && is_executable('/usr/bin/uptime') && $loadavg = `/usr/bin/uptime` ) { 
    12721272        if (preg_match('/load averages?: (\d+[\.:]\d+)/', $loadavg, $matches)) { 
    12731273            $server_load = $matches[1]; 
  • devel/mod/explodeping/lib.php

    r1139 r1273  
    2121     function explodeping_init() { 
    2222         global $CFG, $messages; 
     23 
     24         // FIXME: workaround to annoying warning when is enabled open_basedir  
     25         // restriction 
     26         if (ini_get('open_basedir') || !ini_get('allow_url_fopen')) { return;} 
     27 
    2328         if (!$explodeservice = get_record('datalists', 'name', 'explodeservice')) { 
    2429