Changeset 415
- Timestamp:
- Jul 1, 2013 7:45:33 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bin/acl.cli.php
r398 r415 118 118 break; 119 119 case 'perms' : 120 120 default : 121 121 listPerms(); 122 122 break; -
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)) { -
trunk/lib/Upload.inc.php
r396 r415 279 279 // Check to be sure the file has a valid file name extension. 280 280 if (!in_array(mb_strtolower($this->getFilenameExtension($file_name)), $this->getParam('valid_file_extensions'))) { 281 /// TODO: Add option to allow any extention to be uploaded. 281 282 $this->_raiseMsg(sprintf(_("The file %s failed uploading: it is an unrecognized type. Files must have one of the following file name extensions: %s."), $file_name, join(', ', $this->getParam('valid_file_extensions'))), MSG_ERR, __FILE__, __LINE__); 282 283 $app->logMsg(sprintf('The uploaded file %s has an unrecognized file name extension.', $file_name), LOG_WARNING, __FILE__, __LINE__); … … 295 296 // If the file name has no extension, use the mime-type to choose one. 296 297 if (!preg_match('/\.[^.]{1,5}$/', $file_name) && function_exists('mime_content_type')) { 298 // TODO: will this run if an extention is filtered by 'valid_file_extensions'? 297 299 if ($ext = array_search(mime_content_type($files['tmp_name'][$i]), $this->mime_extension_map)) { 298 300 $file_name .= ".$ext"; -
trunk/lib/Validator.inc.php
r396 r415 40 40 41 41 // validateEmail return types. 42 define('VALIDATE_EMAIL_SUCCESS', 0); 42 43 define('VALIDATE_EMAIL_REGEX_FAIL', 1); 43 44 define('VALIDATE_EMAIL_LENGTH_FAIL', 2); 44 45 define('VALIDATE_EMAIL_MX_FAIL', 3); 45 define('VALIDATE_EMAIL_SUCCESS', 4);46 46 47 47 class Validator { … … 179 179 * 180 180 * @access public 181 * @param string $val The input data to validate..182 * @return bool Validity of address.181 * @param string $val The input data to validate.. 182 * @return const One of the constant values: VALIDATE_EMAIL_SUCCESS|VALIDATE_EMAIL_REGEX_FAIL|VALIDATE_EMAIL_LENGTH_FAIL|VALIDATE_EMAIL_MX_FAIL 183 183 * @author Quinn Comendant <quinn@strangecode.com> 184 184 */ … … 209 209 // Compare ip2long twice for php4 backwards compat. 210 210 if ((ip2long($domain) == '-1' || ip2long($domain) === false) && function_exists('checkdnsrr') && !checkdnsrr($domain . '.', 'MX') && gethostbyname($domain) == $domain) { 211 return VALIDATE_EMAIL_MX_FAIL; 211 // FIXME: Do we care? 212 // return VALIDATE_EMAIL_MX_FAIL; 212 213 } 213 214
Note: See TracChangeset
for help on using the changeset viewer.