Index: trunk/phase3/includes/upload/UploadStash.php |
— | — | @@ -72,7 +72,7 @@ |
73 | 73 | * @param $key Integer: key |
74 | 74 | * @throws UploadStashFileNotFoundException |
75 | 75 | * @throws UploadStashBadVersionException |
76 | | - * @return UploadStashItem: null if no such item or item out of date, or the item |
| 76 | + * @return UploadStashFile |
77 | 77 | */ |
78 | 78 | public function getFile( $key ) { |
79 | 79 | if ( ! preg_match( self::KEY_FORMAT_REGEX, $key ) ) { |
— | — | @@ -81,7 +81,7 @@ |
82 | 82 | |
83 | 83 | if ( !isset( $this->files[$key] ) ) { |
84 | 84 | if ( !isset( $_SESSION[UploadBase::SESSION_KEYNAME][$key] ) ) { |
85 | | - throw new UploadStashFileNotFoundException( "key '$key' not found in session" ); |
| 85 | + throw new UploadStashFileNotFoundException( "key '$key' not found in stash" ); |
86 | 86 | } |
87 | 87 | |
88 | 88 | $data = $_SESSION[UploadBase::SESSION_KEYNAME][$key]; |
— | — | @@ -116,7 +116,7 @@ |
117 | 117 | */ |
118 | 118 | public function stashFile( $path, $data = array(), $key = null ) { |
119 | 119 | if ( ! file_exists( $path ) ) { |
120 | | - throw new UploadStashBadPathException( "path '$path' doesn't exist" ); |
| 120 | + throw new UploadStashBadPathException( "path doesn't exist" ); |
121 | 121 | } |
122 | 122 | $fileProps = File::getPropsFromPath( $path ); |
123 | 123 | |
— | — | @@ -200,12 +200,12 @@ |
201 | 201 | $repoTempPath = $repo->getZonePath( 'temp' ); |
202 | 202 | if ( ( ! $repo->validateFilename( $path ) ) || |
203 | 203 | ( strpos( $path, $repoTempPath ) !== 0 ) ) { |
204 | | - throw new UploadStashBadPathException( "path '$path' is not valid or is not in repo temp area: '$repoTempPath'" ); |
| 204 | + throw new UploadStashBadPathException( 'path is not valid' ); |
205 | 205 | } |
206 | 206 | |
207 | 207 | // check if path exists! and is a plain file. |
208 | 208 | if ( ! $repo->fileExists( $path, FileRepo::FILES_ONLY ) ) { |
209 | | - throw new UploadStashFileNotFoundException( "cannot find path '$path'" ); |
| 209 | + throw new UploadStashFileNotFoundException( 'cannot find path, or not a plain file' ); |
210 | 210 | } |
211 | 211 | |
212 | 212 | parent::__construct( false, $repo, $path, false ); |
— | — | @@ -257,7 +257,7 @@ |
258 | 258 | } |
259 | 259 | |
260 | 260 | if ( is_null( $extension ) ) { |
261 | | - throw new UploadStashFileException( "extension '$extension' is null" ); |
| 261 | + throw new UploadStashFileException( "extension is null" ); |
262 | 262 | } |
263 | 263 | |
264 | 264 | $this->extension = parent::normalizeExtension( $extension ); |