Completed
Push — master ( 7ffcc4...510357 )
by Damian
07:28
created
code/controllers/ShareDraftController.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,7 @@
 block discarded – undo
101 101
 	}
102 102
 
103 103
 	/**
104
-	 * @param mixed $page
104
+	 * @param DataObject|null $page
105 105
 	 *
106 106
 	 * @return mixed
107 107
 	 */
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 		 */
39 39
 		$shareToken = ShareToken::get()->filter('token', $token)->first();
40 40
 
41
-		if(!$shareToken) {
41
+		if (!$shareToken) {
42 42
 			return $this->errorPage();
43 43
 		}
44 44
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
 		$controller = $this->getControllerFor($page);
54 54
 
55
-		if(!$shareToken->isExpired() && $page->generateKey($shareToken->Token) === $key) {
55
+		if (!$shareToken->isExpired() && $page->generateKey($shareToken->Token) === $key) {
56 56
 			Requirements::css(SHAREDRAFTCONTENT_DIR . '/css/top-bar.css');
57 57
 
58 58
 			// Temporarily un-secure the draft site and switch to draft
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 					'Latest' => $latest,
80 80
 				));
81 81
 				$include = (string) $data->renderWith('Includes/TopBar');
82
-			} catch(Exception $ex) {
82
+			} catch (Exception $ex) {
83 83
 				$restore();
84 84
 				throw $ex;
85 85
 			}
Please login to merge, or discard this patch.
code/extensions/ShareDraftContentControllerExtension.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 	 */
14 14
 	public function MakeShareDraftLink() {
15 15
 		if ($member = Member::currentUser()) {
16
-			if($this->owner->hasMethod('CurrentPage') && $this->owner->CurrentPage()->canEdit($member)) {
16
+			if ($this->owner->hasMethod('CurrentPage') && $this->owner->CurrentPage()->canEdit($member)) {
17 17
 				return $this->owner->CurrentPage()->ShareTokenLink();
18 18
 			} elseif ($this->owner->hasMethod('canEdit') && $this->owner->canEdit($member)) {
19 19
 				return $this->owner->ShareTokenLink();
Please login to merge, or discard this patch.
code/extensions/ShareDraftContentSiteTreeExtension.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	 * @return ShareToken
48 48
 	 */
49 49
 	protected function getNewShareToken() {
50
-		if(!$this->owner->ShareTokenSalt) {
50
+		if (!$this->owner->ShareTokenSalt) {
51 51
 			$this->owner->ShareTokenSalt = $this->getNewToken();
52 52
 			$this->owner->write();
53 53
 		}
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 		$tries = 1;
58 58
 		$limit = 5;
59 59
 
60
-		while(!$found && ($tries++ < $limit)) {
60
+		while (!$found && ($tries++ < $limit)) {
61 61
 			$token = $this->getNewToken();
62 62
 
63 63
 			$found = ShareToken::get()->filter(array(
Please login to merge, or discard this patch.
code/tasks/RemoveExpiredShareTokensTask.php 2 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Remove expired share tokens.
4
- *
5
- * Action to remove all expired ShareTokens from the database.
6
- *
7
- * To run this action the user needs admin rights.
8
- */
3
+	 * Remove expired share tokens.
4
+	 *
5
+	 * Action to remove all expired ShareTokens from the database.
6
+	 *
7
+	 * To run this action the user needs admin rights.
8
+	 */
9 9
 class RemoveExpiredShareTokens extends BuildTask {
10 10
 
11 11
 	protected $title = 'Remove expired share tokens';
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
 	public function init() {
16 16
 		parent::init();
17 17
 
18
-		if(!Permission::check('ADMIN')) {
18
+		if (!Permission::check('ADMIN')) {
19 19
 			return Security::permissionFailure($this);
20 20
 		}
21 21
 	}
Please login to merge, or discard this patch.