Index: trunk/phase3/includes/upload/UploadStash.php |
— | — | @@ -44,6 +44,10 @@ |
45 | 45 | |
46 | 46 | $this->repo = $repo; |
47 | 47 | |
| 48 | + if ( ! isset( $_SESSION ) ) { |
| 49 | + throw new UploadStashNotAvailableException( 'no session variable' ); |
| 50 | + } |
| 51 | + |
48 | 52 | if ( !isset( $_SESSION[UploadBase::SESSION_KEYNAME] ) ) { |
49 | 53 | $_SESSION[UploadBase::SESSION_KEYNAME] = array(); |
50 | 54 | } |
Index: trunk/phase3/includes/specials/SpecialUploadStash.php |
— | — | @@ -25,10 +25,13 @@ |
26 | 26 | |
27 | 27 | // $request is the request (usually wgRequest) |
28 | 28 | // $subpage is everything in the URL after Special:UploadStash |
29 | | - // FIXME: These parameters don't match SpecialPage::__construct()'s params at all, and are unused --RK |
30 | | - public function __construct( $request = null, $subpage = null ) { |
31 | | - parent::__construct( 'UploadStash', 'upload' ); |
32 | | - $this->stash = new UploadStash(); |
| 29 | + public function __construct( $name, $restriction = '', $function = false, $file = 'default' ) { |
| 30 | + parent::__construct( $name, 'upload' ); |
| 31 | + try { |
| 32 | + $this->stash = new UploadStash( ); |
| 33 | + } catch (UploadStashNotAvailableException $e) { |
| 34 | + return null; |
| 35 | + } |
33 | 36 | } |
34 | 37 | |
35 | 38 | /** |