blogs ) ) ) { if ( $id == get_main_site_id() ) { // no child sites in the network $dir = cerber_get_upload_dir(); } else { $tmp = $blog_id; $blog_id = $id; $wp_upload_dir = wp_upload_dir(); $blog_id = $tmp; $site_dir = rtrim( $wp_upload_dir['basedir'], '/' ) . '/'; // A new network created post-3.5 $end = '/sites/' . $id.'/'; if ( $p = mb_strpos( $site_dir, $end ) ) { $dir = mb_substr( $site_dir, 0, $p ); } else { $id = 1; // workaround for old MU installations $end = '/' . $id . '/files/'; if ( $p = mb_strpos( $site_dir, $end ) ) { $dir = mb_substr( $site_dir, 0, $p ); } else { // A custom path has been configured by site admin? // see also UPLOADS, BLOGUPLOADDIR, BLOGUPLOADDIR $dir = ABSPATH.UPLOADBLOGSDIR; if ( ! file_exists( $dir ) ) { $dir = false; } } } if ( $dir ) { $dir = cerber_normal_path( $dir ); } } } else { $dir = cerber_get_upload_dir(); } } return $dir; } function cerber_get_abspath() { static $abspath; if ( $abspath === null ) { $abspath = cerber_normal_path( ABSPATH ); } return $abspath; } function cerber_request_time() { static $stamp = null; if ( ! isset( $stamp ) ) { if ( ! empty( $_SERVER['REQUEST_TIME_FLOAT'] ) ) { // PHP >= 5.4 $stamp = filter_var( $_SERVER['REQUEST_TIME_FLOAT'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); } $mt = microtime( true ); if ( ! $stamp || $stamp > ( $mt + 300 ) ) { // Some platforms may have wrong value in 'REQUEST_TIME_FLOAT' $stamp = $mt; } } return $stamp; } cerber_request_time(); require_once( dirname( __FILE__ ) . '/cerber-load.php' ); cerber_init();