Plugin Directory

Changeset 613609


Ignore:
Timestamp:
10/17/2012 02:02:37 PM (13 years ago)
Author:
ti2m
Message:

permission fix + additional file checks

Location:
edge-suite/trunk/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • edge-suite/trunk/includes/edge-suite-comp-builder.inc

    r608321 r613609  
    401401  protected function alterMainEdgeJs() {
    402402    $file = $this->mainEdgeJS;
     403    // Do an extensive file / permission check as this seems to fail with many server configs.
     404    if(!file_exists($file)){
     405      throw new Exception('Main edge file ' . $file . ' does not exist.');
     406    }
     407
     408    if(!is_readable($file)){
     409      throw new Exception('Main edge file' . $file . ' exists but is not readable.');
     410    }
     411
    403412    $content = file_get_contents($file);
     413    if(!isset($content) || empty($content)){
     414      throw new Exception('Main edge file ' . $file . ' does exist, cleared is_readable check, but can not be read.');
     415    }
    404416
    405417    $this->parseDimensions($content);
  • edge-suite/trunk/includes/edge-suite-general.php

    r608321 r613609  
    8282    $filesystem = new WP_Filesystem_Direct(null);
    8383
     84    // Set up default file/folder permissions (copied from WP_Filesystem()).
     85    if ( ! defined('FS_CHMOD_DIR') )
     86      define('FS_CHMOD_DIR', 0755 );
     87    if ( ! defined('FS_CHMOD_FILE') )
     88      define('FS_CHMOD_FILE', 0644 );
     89
    8490    $z = new ZipArchive();
    8591
Note: See TracChangeset for help on using the changeset viewer.