@@ -135,7 +135,9 @@ discard block |
||
| 135 | 135 | // set the variables which have changed |
| 136 | 136 | $comment->BaseClass = 'SiteTree'; |
| 137 | 137 | $comment->URL = (isset($pageComment['CommenterURL'])) ? $pageComment['CommenterURL'] : ''; |
| 138 | - if((int) $pageComment['NeedsModeration'] == 0) $comment->Moderated = true; |
|
| 138 | + if((int) $pageComment['NeedsModeration'] == 0) { |
|
| 139 | + $comment->Moderated = true; |
|
| 140 | + } |
|
| 139 | 141 | |
| 140 | 142 | $comment->write(); |
| 141 | 143 | } |
@@ -206,8 +208,7 @@ discard block |
||
| 206 | 208 | if(!$record && $this->BaseClass) { |
| 207 | 209 | // Otherwise a singleton of that record |
| 208 | 210 | $record = singleton($this->BaseClass); |
| 209 | - } |
|
| 210 | - else if(!$record) { |
|
| 211 | + } else if(!$record) { |
|
| 211 | 212 | // Otherwise just use the default options |
| 212 | 213 | $record = singleton('CommentsExtension'); |
| 213 | 214 | } |
@@ -405,8 +406,12 @@ discard block |
||
| 405 | 406 | * @return string |
| 406 | 407 | */ |
| 407 | 408 | protected function actionLink($action, $member = null) { |
| 408 | - if(!$member) $member = Member::currentUser(); |
|
| 409 | - if(!$member) return false; |
|
| 409 | + if(!$member) { |
|
| 410 | + $member = Member::currentUser(); |
|
| 411 | + } |
|
| 412 | + if(!$member) { |
|
| 413 | + return false; |
|
| 414 | + } |
|
| 410 | 415 | |
| 411 | 416 | $url = Controller::join_links( |
| 412 | 417 | Director::baseURL(), |
@@ -855,7 +860,9 @@ discard block |
||
| 855 | 860 | */ |
| 856 | 861 | public function checkRequest($request) { |
| 857 | 862 | $member = Member::currentUser(); |
| 858 | - if(!$member) return false; |
|
| 863 | + if(!$member) { |
|
| 864 | + return false; |
|
| 865 | + } |
|
| 859 | 866 | |
| 860 | 867 | $salt = $request->getVar('s'); |
| 861 | 868 | $memberSalt = $this->memberSalt($salt, $member); |
@@ -876,7 +883,9 @@ discard block |
||
| 876 | 883 | protected function generate($length = null) { |
| 877 | 884 | $generator = new RandomGenerator(); |
| 878 | 885 | $result = $generator->randomToken('sha256'); |
| 879 | - if($length !== null) return substr($result, 0, $length); |
|
| 886 | + if($length !== null) { |
|
| 887 | + return substr($result, 0, $length); |
|
| 888 | + } |
|
| 880 | 889 | return $result; |
| 881 | 890 | } |
| 882 | 891 | } |