Ignore:
Timestamp:
Jul 1, 2013 7:45:33 PM (11 years ago)
Author:
anonymous
Message:

Disabled MX record check for email validation. Updated PEdit to work better with AcceptPathInfo? enabled.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/PEdit.inc.php

    r396 r415  
    168168       
    169169        // The location of the data file. (i.e.: "COMMON_DIR/html/_pedit_data/news/index.xml")
    170         $this->_data_file = sprintf('%s%s.xml', $this->getParam('data_dir'), $_SERVER['PHP_SELF']);
     170        $this->_data_file = sprintf('%s%s.xml', $this->getParam('data_dir'), $_SERVER['SCRIPT_NAME']);
     171       
     172        // Make certain the evaluated path matches the assumed path (realpath will expand /../../);
     173        // if realpath returns FALSE we're not concerned because it means the file doesn't exist (_initializeDataFile() will create it).
     174        if (false !== realpath($this->_data_file) && $this->_data_file !== realpath($this->_data_file)) {
     175            $app->logMsg(sprintf('PEdit data file not a real path: %s', $this->_data_file), LOG_CRIT, __FILE__, __LINE__);
     176            trigger_error(sprintf('PEdit data file not a real path: %s', $this->_data_file), E_USER_ERROR);
     177        }
    171178
    172179        // op is used throughout the script to determine state.
     
    559566        // Ensure requested filename is within the pedit data dir.
    560567        if (mb_strpos($filename, $this->getParam('data_dir')) === false) {
    561             $app->logMsg(sprintf('Failed writing file outside pedit _data_dir: %s', $filename), LOG_ERR, __FILE__, __LINE__);
     568            $app->logMsg(sprintf('Failed writing file outside pedit data_dir: %s', $filename), LOG_ERR, __FILE__, __LINE__);
    562569            return false;
    563570        }
     
    565572        // Recursively create directories.
    566573        $subdirs = preg_split('!/!', str_replace($this->getParam('data_dir'), '', dirname($filename)), -1, PREG_SPLIT_NO_EMPTY);
    567         // Start with the pedit _data_dir base.
     574        // Start with the pedit data_dir base.
    568575        $curr_path = $this->getParam('data_dir');
    569576        while (!empty($subdirs)) {
Note: See TracChangeset for help on using the changeset viewer.