Passed
Push — master ( f02a11...57e0bd )
by Vitalii
14:13 queued 13:14
created
html/user/create_account_form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@
 block discarded – undo
64 64
     }
65 65
 }
66 66
 
67
-form_start("create_account_action.php","post");
67
+form_start("create_account_action.php", "post");
68 68
 create_account_form($teamid, $next_url);
69 69
 global $recaptcha_public_key;
70 70
 if ($recaptcha_public_key) {
Please login to merge, or discard this patch.
html/user/pending.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
     $sum = 0;
48 48
     echo "<pending_credit>\n";
49 49
     $results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0");
50
-    foreach($results as $result) {
50
+    foreach ($results as $result) {
51 51
         echo "<result>\n";
52 52
         echo "    <resultid>".$result->id."</resultid>\n";
53 53
         echo "    <workunitid>".$result->workunitid."</workunitid>\n";
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
     start_table();
68 68
     echo "<tr><th>".tra("Result ID")."</th><th>".tra("Workunit ID")."</th><th>".tra("Host ID")."</th><th>".tra("Claimed credit")."</th></tr>\n";
69 69
     $results = BoincResult::enum("userid=$user->id AND (validate_state=0 OR validate_state=4) AND claimed_credit > 0");
70
-    foreach($results as $result) {
70
+    foreach ($results as $result) {
71 71
         echo "<tr>\n";
72 72
         echo "<td><a href=\"result.php?resultid=$result->id\">$result->id</a></td>\n";
73 73
         echo "<td><a href=\"workunit.php?wuid=$result->workunitid\">$result->workunitid</a></td>\n";
Please login to merge, or discard this patch.
html/user/show_user.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
 }
39 39
 $format = get_str("format", true);
40 40
 
41
-if ($format=="xml"){
41
+if ($format == "xml") {
42 42
     // don't do caching for XML
43 43
     xml_header();
44 44
     $retval = db_init_xml();
45 45
     if ($retval) xml_error($retval);
46
-    if ($auth){
46
+    if ($auth) {
47 47
         $user = BoincUser::lookup_auth($auth);
48 48
         $show_hosts = true;
49 49
     } else {
@@ -57,9 +57,9 @@  discard block
 block discarded – undo
57 57
     // The page may be presented in many different languages,
58 58
     // so here we cache the data instead
59 59
     //
60
-    $cache_args="userid=".$id;
60
+    $cache_args = "userid=".$id;
61 61
     $cached_data = get_cached_data(USER_PAGE_TTL, $cache_args);
62
-    if ($cached_data){
62
+    if ($cached_data) {
63 63
         // We found some old but non-stale data, let's use it
64 64
         $data = unserialize($cached_data);
65 65
         $user = $data->user;
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         }
76 76
         BoincForumPrefs::lookup($user);
77 77
         $user = @get_other_projects($user);
78
-        $community_links =  get_community_links_object($user);
78
+        $community_links = get_community_links_object($user);
79 79
 
80 80
         $data = new StdClass;
81 81
         $data->user = $user;
Please login to merge, or discard this patch.
html/user/profile_menu.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 start_table();
42 42
 
43 43
 $today = getdate(time());
44
-$UOTD_heading = tra("User of the Day")." -- " . $today['month'] . " " . $today['mday'] . ", " . $today['year'];
44
+$UOTD_heading = tra("User of the Day")." -- ".$today['month']." ".$today['mday'].", ".$today['year'];
45 45
 row1($UOTD_heading);
46 46
 echo "<tr><td>";
47 47
     $profile = get_current_uotd();
@@ -59,15 +59,15 @@  discard block
 block discarded – undo
59 59
 row1(tra("User Profile Explorer"));
60 60
 echo "<tr><td>
61 61
     <ul>
62
-    <li>".tra("View the %1 User Picture Gallery %2.", "<a href=\"" . url_base() . "user_profile/user_gallery_1.html\">", "</a>")."</li>
63
-    <li>".tra("Browse profiles %1 by country %2.", "<a href=\"" . url_base() . "user_profile/profile_country.html\">", "</a>")."</li>
62
+    <li>".tra("View the %1 User Picture Gallery %2.", "<a href=\"".url_base()."user_profile/user_gallery_1.html\">", "</a>")."</li>
63
+    <li>".tra("Browse profiles %1 by country %2.", "<a href=\"".url_base()."user_profile/profile_country.html\">", "</a>")."</li>
64 64
     <li>".tra("Browse profiles %1 at random %2, %3 at random with pictures %2, or %4 at random without pictures %2.", "<a href=\"?cmd=rand&amp;pic=-1\">", "</a>",
65 65
             "<a href=\"?cmd=rand&amp;pic=1\">", "<a href=\"?cmd=rand&amp;pic=0\">")."</li>
66 66
 ";
67
-if (file_exists(PROFILE_PATH . "profile_alpha.html")) {
67
+if (file_exists(PROFILE_PATH."profile_alpha.html")) {
68 68
     echo "<li>".tra("Alphabetical profile listings:")."<br>";
69 69
 
70
-    include( PROFILE_PATH . "profile_alpha.html" );
70
+    include(PROFILE_PATH."profile_alpha.html");
71 71
 }
72 72
 echo "</ul></td></tr>";
73 73
 
Please login to merge, or discard this patch.
html/user/forum_search_action.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -31,10 +31,10 @@  discard block
 block discarded – undo
31 31
 // Optionally filters by forum, user, time, or hidden if specified.
32 32
 //
33 33
 function search_thread_titles(
34
-    $keyword_list, $forum="", $user="", $time="", $limit=200,
35
-    $sort_style=CREATE_TIME_NEW, $show_hidden = false
36
-){
37
-    $search_string="%";
34
+    $keyword_list, $forum = "", $user = "", $time = "", $limit = 200,
35
+    $sort_style = CREATE_TIME_NEW, $show_hidden = false
36
+) {
37
+    $search_string = "%";
38 38
     foreach ($keyword_list as $key => $word) {
39 39
         $search_string .= BoincDb::escape_string($word)."%";
40 40
     }
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     if (!$show_hidden) {
52 52
         $query .= " and thread.hidden = 0";
53 53
     }
54
-    switch($sort_style) {
54
+    switch ($sort_style) {
55 55
     case MODIFIED_NEW:
56 56
         $query .= ' ORDER BY timestamp DESC';
57 57
         break;
@@ -84,11 +84,11 @@  discard block
 block discarded – undo
84 84
 //
85 85
 function search_post_content(
86 86
     $keyword_list, $forum, $user, $time, $limit, $sort_style, $show_hidden
87
-){
87
+) {
88 88
     $db = BoincDb::get();
89 89
 
90
-    $search_string="%";
91
-    foreach ($keyword_list as $key => $word){
90
+    $search_string = "%";
91
+    foreach ($keyword_list as $key => $word) {
92 92
         $search_string .= BoincDb::escape_string($word)."%";
93 93
     }
94 94
     $optional_join = "";
@@ -100,20 +100,20 @@  discard block
 block discarded – undo
100 100
     }
101 101
     $query = "select post.* from ".$db->db_name.".post".$optional_join." where content like '".$search_string."'";
102 102
     if ($forum) {
103
-        $query.=" and forum = $forum->id";
103
+        $query .= " and forum = $forum->id";
104 104
     }
105 105
     if ($user) {
106
-        $query.=" and post.user = $user->id ";
106
+        $query .= " and post.user = $user->id ";
107 107
     }
108 108
     if ($time) {
109
-        $query.=" and post.timestamp > $time";
109
+        $query .= " and post.timestamp > $time";
110 110
     }
111 111
     if (!$show_hidden) {
112 112
         $query .= " AND post.hidden = 0";
113 113
     }
114
-    switch($sort_style) {
114
+    switch ($sort_style) {
115 115
     case VIEWS_MOST:
116
-        $query.= ' ORDER BY views DESC';
116
+        $query .= ' ORDER BY views DESC';
117 117
         break;
118 118
     case CREATE_TIME_NEW:
119 119
         $query .= ' ORDER by post.timestamp desc';
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
         $query .= ' ORDER BY post.timestamp DESC';
129 129
         break;
130 130
     }
131
-    $query.= " limit $limit";
131
+    $query .= " limit $limit";
132 132
     return BoincPost::enum_general($query);
133 133
 }
134 134
 
135 135
 $logged_in_user = get_logged_in_user(false);
136 136
 BoincForumPrefs::lookup($logged_in_user);
137
-if ($logged_in_user && $logged_in_user->prefs->privilege(S_MODERATOR)){
137
+if ($logged_in_user && $logged_in_user->prefs->privilege(S_MODERATOR)) {
138 138
     $show_hidden_posts = true;
139 139
 } else {
140 140
     $show_hidden_posts = false;
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 $search_max_time = post_int("search_max_time");
148 148
 $search_forum = post_int("search_forum");
149 149
 $search_sort = post_int("search_sort");
150
-$search_list = explode(" ",$search_keywords);
150
+$search_list = explode(" ", $search_keywords);
151 151
 if ($search_max_time) {
152 152
     $min_timestamp = time() - ($search_max_time*3600*24);
153 153
 } else {
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
 $limit = 100;
158 158
 
159
-if ($search_forum==-1){
159
+if ($search_forum == -1) {
160 160
     $forum = null;
161 161
 } else if ($search_forum) {
162 162
     $forum = BoincForum::lookup_id($search_forum);
@@ -173,11 +173,11 @@  discard block
 block discarded – undo
173 173
 
174 174
 // Display the threads while we search for posts
175 175
 //
176
-if (count($threads)){
177
-    echo "<h3>" . tra("Thread titles matching your query:") . "</h3>";
176
+if (count($threads)) {
177
+    echo "<h3>".tra("Thread titles matching your query:")."</h3>";
178 178
     start_table('table-striped');
179 179
     thread_list_header();
180
-    foreach ($threads as $thread){
180
+    foreach ($threads as $thread) {
181 181
         if ($thread->hidden) continue;
182 182
         thread_list_item($thread, $logged_in_user);
183 183
     }
@@ -193,8 +193,8 @@  discard block
 block discarded – undo
193 193
     $show_hidden_posts
194 194
 );
195 195
 
196
-if (count($posts)){
197
-    echo "<h3>" . tra("Messages matching your query:") . "</h3>";
196
+if (count($posts)) {
197
+    echo "<h3>".tra("Messages matching your query:")."</h3>";
198 198
     start_table('table-striped');
199 199
     row_heading_array(['Info', 'Post'], ['', 'width=70%']);
200 200
     $n = 1;
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
     end_table();
218 218
 }
219 219
 
220
-if (!count($threads) && !count($posts)){
220
+if (!count($threads) && !count($posts)) {
221 221
     echo "<p>".tra("Sorry, couldn't find anything matching your search query. You can try to broaden your search by using less words (or less specific words).")."</p>
222 222
     <p>"
223 223
     .tra("You can also %1 try the same search on Google. %2",
Please login to merge, or discard this patch.
html/user/forum_reply.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
     $parent_post_id = 0;
57 57
 }
58 58
 
59
-if ($filter != "false"){
59
+if ($filter != "false") {
60 60
     $filter = true;
61 61
 } else {
62 62
     $filter = false;
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 }
72 72
 
73 73
 $warning = null;
74
-if ($content && (!$preview)){
74
+if ($content && (!$preview)) {
75 75
     check_tokens($logged_in_user->authenticator);
76 76
     if (!akismet_check($logged_in_user, $content)) {
77 77
         $warning = tra("Your post has been flagged as spam by the Akismet anti-spam system. Please modify your text and try again.");
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
     }
94 94
 }
95 95
 
96
-page_head(tra("Post to thread")." '$thread->title'",'','','', $bbcode_js);
96
+page_head(tra("Post to thread")." '$thread->title'", '', '', '', $bbcode_js);
97 97
 
98 98
 if ($parent_post) {
99 99
     echo sprintf(
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
     $x2 .= " method=\"post\" name=\"post\" onsubmit=\"return checkForm(this)\">\n";
162 162
     $x2 .= form_tokens($logged_in_user->authenticator);
163 163
     $x2 .= $bbcode_html."<textarea class=\"form-control\" name=\"content\" rows=\"18\">";
164
-    $no_quote = get_int("no_quote", true)==1;
164
+    $no_quote = get_int("no_quote", true) == 1;
165 165
     if ($preview) {
166 166
         $x2 .= htmlspecialchars($content);
167 167
     } else if (!$no_quote) {
@@ -170,9 +170,9 @@  discard block
 block discarded – undo
170 170
         }
171 171
     }
172 172
     if (!$logged_in_user->prefs->no_signature_by_default) {
173
-        $enable_signature='checked="true"';
173
+        $enable_signature = 'checked="true"';
174 174
     } else {
175
-        $enable_signature="";
175
+        $enable_signature = "";
176 176
     }
177 177
     $x2 .= sprintf('</textarea><p> </p>
178 178
         <input class="btn btn-sm" %s type="submit" name="preview" value="%s">
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
     return sprintf(
201 201
         'In reply to %s\'s message of %s:
202 202
         [quote]%s[/quote]',
203
-        $user?$user->name:'unknown user',
203
+        $user ? $user->name : 'unknown user',
204 204
         date_str($post->timestamp),
205 205
         htmlspecialchars($post->content)
206 206
     );
Please login to merge, or discard this patch.
html/user/forum_banishment_vote_action.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 
38 38
 // See if "action" is provided - either through post or get
39 39
 if (!post_str('action', true)) {
40
-    if (!get_str('action', true)){
40
+    if (!get_str('action', true)) {
41 41
 	    error_page(tra("You must specify an action..."));
42 42
     } else {
43 43
         $action = get_str('action');
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 }
48 48
 
49 49
 $userid = post_int('userid');
50
-$user=BoincUser::lookup_id($userid);
50
+$user = BoincUser::lookup_id($userid);
51 51
 
52
-if ($action!="start"){
52
+if ($action != "start") {
53 53
     error_page("Unknown action");
54 54
 }
55 55
 
@@ -65,10 +65,10 @@  discard block
 block discarded – undo
65 65
         $mod_category = tra("Other");
66 66
 }
67 67
 
68
-if (post_str('reason', true)){
69
-    start_vote($config,$logged_in_user,$user, $mod_category,post_str("reason"));
68
+if (post_str('reason', true)) {
69
+    start_vote($config, $logged_in_user, $user, $mod_category, post_str("reason"));
70 70
 } else {
71
-    start_vote($config,$logged_in_user,$user, $mod_category,"None given");
71
+    start_vote($config, $logged_in_user, $user, $mod_category, "None given");
72 72
 }
73 73
 
74 74
 ?>
Please login to merge, or discard this patch.
html/user/forum_post.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
 $preview = post_str("preview", true);
57 57
 $warning = null;
58 58
 
59
-if ($content && $title && (!$preview)){
59
+if ($content && $title && (!$preview)) {
60 60
     if (post_str('add_signature', true)) {
61
-        $add_signature = true;    // set a flag and concatenate later
62
-    }  else {
61
+        $add_signature = true; // set a flag and concatenate later
62
+    } else {
63 63
         $add_signature = false;
64 64
     }
65 65
     check_tokens($logged_in_user->authenticator);
@@ -74,14 +74,14 @@  discard block
 block discarded – undo
74 74
             if (post_str('subscribe', true)) {
75 75
                 BoincSubscription::replace($logged_in_user->id, $thread->id);
76 76
             }
77
-            header('Location: forum_thread.php?id=' . $thread->id);
77
+            header('Location: forum_thread.php?id='.$thread->id);
78 78
         } else {
79 79
             error_page("Can't create thread.  $forum_error");
80 80
         }
81 81
     }
82 82
 }
83 83
 
84
-page_head(tra("Create new thread"),'','','', $bbcode_js);
84
+page_head(tra("Create new thread"), '', '', '', $bbcode_js);
85 85
 show_forum_header($logged_in_user);
86 86
 
87 87
 if ($warning) {
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
     $submit_help = "<br /><font color=\"red\">".tra("Remember to add a title")."</font>";
123 123
 }
124 124
 
125
-if ($force_title && $title){
125
+if ($force_title && $title) {
126 126
     row2(
127 127
         tra("Title"),
128 128
         sprintf(
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
     row2(
137 137
         tra("Title").$submit_help,
138 138
         sprintf('<input type="text" class="form-control" name="title" value="%s">',
139
-            $title?htmlspecialchars($title):''
139
+            $title ?htmlspecialchars($title) : ''
140 140
         ),
141 141
         null, FORUM_LH_PCT
142 142
     );
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
     sprintf(
148 148
         '%s <textarea class="form-control" name="content" rows="12" cols="80">%s</textarea>',
149 149
         $bbcode_html,
150
-        $content?htmlspecialchars($content):''
150
+        $content ?htmlspecialchars($content) : ''
151 151
     ),
152 152
     null, FORUM_LH_PCT
153 153
 );
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 if (!$logged_in_user->prefs->no_signature_by_default) {
156 156
     $enable_signature = 'checked="true"';
157 157
 } else {
158
-    $enable_signature='';
158
+    $enable_signature = '';
159 159
 }
160 160
 
161 161
 if (is_news_forum($forum)) {
Please login to merge, or discard this patch.
html/user/team_change_founder_form.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
     if ($user->id != $team->userid) {       //don't show current founder
96 96
         $user_total_credit = format_credit($user->total_credit);
97 97
         $user_expavg_credit = format_credit($user->expavg_credit);
98
-        $selected = ($user->id == $team->ping_user)?"selected":"";
98
+        $selected = ($user->id == $team->ping_user) ? "selected" : "";
99 99
         echo '
100 100
             <tr>
101 101
             <td><input type="radio" name="userid" value="'.$user->id.'">
Please login to merge, or discard this patch.