From: Neil Kandalgaonkar Date: Mon, 15 Nov 2010 23:49:16 +0000 (+0000) Subject: updated comments, error messages. Removing exposure of actual paths in error message... X-Git-Tag: 1.31.0-rc.0~33873 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=0ffa744c147369253e95f1f5f7ede8adb7266d29;p=lhc%2Fweb%2Fwiklou.git updated comments, error messages. Removing exposure of actual paths in error message, while convenient for a developer it probably should not be exposed to the public. --- diff --git a/includes/upload/UploadStash.php b/includes/upload/UploadStash.php index 92033cc3d3..29124d4310 100644 --- a/includes/upload/UploadStash.php +++ b/includes/upload/UploadStash.php @@ -72,7 +72,7 @@ class UploadStash { * @param $key Integer: key * @throws UploadStashFileNotFoundException * @throws UploadStashBadVersionException - * @return UploadStashItem: null if no such item or item out of date, or the item + * @return UploadStashFile */ public function getFile( $key ) { if ( ! preg_match( self::KEY_FORMAT_REGEX, $key ) ) { @@ -81,7 +81,7 @@ class UploadStash { if ( !isset( $this->files[$key] ) ) { if ( !isset( $_SESSION[UploadBase::SESSION_KEYNAME][$key] ) ) { - throw new UploadStashFileNotFoundException( "key '$key' not found in session" ); + throw new UploadStashFileNotFoundException( "key '$key' not found in stash" ); } $data = $_SESSION[UploadBase::SESSION_KEYNAME][$key]; @@ -116,7 +116,7 @@ class UploadStash { */ public function stashFile( $path, $data = array(), $key = null ) { if ( ! file_exists( $path ) ) { - throw new UploadStashBadPathException( "path '$path' doesn't exist" ); + throw new UploadStashBadPathException( "path doesn't exist" ); } $fileProps = File::getPropsFromPath( $path ); @@ -200,12 +200,12 @@ class UploadStashFile extends UnregisteredLocalFile { $repoTempPath = $repo->getZonePath( 'temp' ); if ( ( ! $repo->validateFilename( $path ) ) || ( strpos( $path, $repoTempPath ) !== 0 ) ) { - throw new UploadStashBadPathException( "path '$path' is not valid or is not in repo temp area: '$repoTempPath'" ); + throw new UploadStashBadPathException( 'path is not valid' ); } // check if path exists! and is a plain file. if ( ! $repo->fileExists( $path, FileRepo::FILES_ONLY ) ) { - throw new UploadStashFileNotFoundException( "cannot find path '$path'" ); + throw new UploadStashFileNotFoundException( 'cannot find path, or not a plain file' ); } parent::__construct( false, $repo, $path, false ); @@ -257,7 +257,7 @@ class UploadStashFile extends UnregisteredLocalFile { } if ( is_null( $extension ) ) { - throw new UploadStashFileException( "extension '$extension' is null" ); + throw new UploadStashFileException( "extension is null" ); } $this->extension = parent::normalizeExtension( $extension );