Changeset 415 for trunk/lib/PEdit.inc.php
- Timestamp:
- Jul 1, 2013 7:45:33 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/PEdit.inc.php
r396 r415 168 168 169 169 // 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 } 171 178 172 179 // op is used throughout the script to determine state. … … 559 566 // Ensure requested filename is within the pedit data dir. 560 567 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__); 562 569 return false; 563 570 } … … 565 572 // Recursively create directories. 566 573 $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. 568 575 $curr_path = $this->getParam('data_dir'); 569 576 while (!empty($subdirs)) {
Note: See TracChangeset
for help on using the changeset viewer.