Skip to content

Commit a3f5704

Browse files
committed
Revert "Do not use quotes for numbers"
This reverts commit af7cf00
1 parent ddbb591 commit a3f5704

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+515
-518
lines changed

featherbb/Controller/Admin/Forums.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,20 +84,20 @@ public function edit($req, $res, $args)
8484
foreach ($permissions as $permGroup) {
8585
$permissionsData = ['group_id' => $permGroup['g_id'],
8686
'forum_id' => $args['id']];
87-
if ($permGroup['board.read'] == 1 && isset(Input::post('read_forum_new')[$permGroup['g_id']]) && Input::post('read_forum_new')[$permGroup['g_id']] == 1) {
88-
$permissionsData['read_forum'] = 1;
87+
if ($permGroup['board.read'] == '1' && isset(Input::post('read_forum_new')[$permGroup['g_id']]) && Input::post('read_forum_new')[$permGroup['g_id']] == '1') {
88+
$permissionsData['read_forum'] = '1';
8989
} else {
90-
$permissionsData['read_forum'] = 0;
90+
$permissionsData['read_forum'] = '0';
9191
}
9292

93-
$permissionsData['post_replies'] = (isset(Input::post('post_replies_new')[$permGroup['g_id']])) ? 1 : 0;
94-
$permissionsData['post_topics'] = (isset(Input::post('post_topics_new')[$permGroup['g_id']])) ? 1 : 0;
93+
$permissionsData['post_replies'] = (isset(Input::post('post_replies_new')[$permGroup['g_id']])) ? '1' : '0';
94+
$permissionsData['post_topics'] = (isset(Input::post('post_topics_new')[$permGroup['g_id']])) ? '1' : '0';
9595
// Check if the new settings differ from the old
9696
if ($permissionsData['read_forum'] != Input::post('read_forum_old')[$permGroup['g_id']] ||
9797
$permissionsData['post_replies'] != Input::post('post_replies_old')[$permGroup['g_id']] ||
9898
$permissionsData['post_topics'] != Input::post('post_topics_old')[$permGroup['g_id']]) {
9999
// If there is no group permissions override for this forum
100-
if ($permissionsData['read_forum'] == 1 && $permissionsData['post_replies'] == $permGroup['topic.reply'] && $permissionsData['post_topics'] == $permGroup['topic.post']) {
100+
if ($permissionsData['read_forum'] == '1' && $permissionsData['post_replies'] == $permGroup['topic.reply'] && $permissionsData['post_topics'] == $permGroup['topic.post']) {
101101
$this->model->deletePermissions($args['id'], $permGroup['g_id']);
102102
} else {
103103
// Run an UPDATE and see if it affected a row, if not, INSERT

featherbb/Controller/Api/Post.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function delete($req, $res, $args)
3535
return $curPost;
3636
}
3737

38-
if (ForumSettings::get('o_censoring') == 1) {
38+
if (ForumSettings::get('o_censoring') == '1') {
3939
$curPost['subject'] = Utils::censor($curPost['subject']);
4040
}
4141

@@ -60,7 +60,7 @@ public function update($req, $res, $args)
6060

6161
$canEditSubject = $args['id'] == $curPost['first_post_id'];
6262

63-
if (ForumSettings::get('o_censoring') == 1) {
63+
if (ForumSettings::get('o_censoring') == '1') {
6464
$curPost['subject'] = Utils::censor($curPost['subject']);
6565
$curPost['message'] = Utils::censor($curPost['message']);
6666
}

featherbb/Controller/Api/Topic.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function newTopic($req, $res, $args)
5757
$new = $this->model->insertTopic($post, $args['id']);
5858

5959
// Should we send out notifications?
60-
if (ForumSettings::get('o_forum_subscriptions') == 1) {
60+
if (ForumSettings::get('o_forum_subscriptions') == '1') {
6161
$this->model->sendNotificationsNewTopic($post, $curPosting, $new['tid']);
6262
}
6363

@@ -113,7 +113,7 @@ public function newReply($req, $res, $args)
113113
$new = $this->model->insertReply($post, $args['id'], $curPosting, $isSubscribed);
114114

115115
// Should we send out notifications?
116-
if (ForumSettings::get('o_topic_subscriptions') == 1) {
116+
if (ForumSettings::get('o_topic_subscriptions') == '1') {
117117
\FeatherBB\Model\Post::sendNotificationsReply($args['id'], $curPosting, $new['pid'], $post);
118118
}
119119

featherbb/Controller/Forum.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function display($req, $res, $args)
4848
$sortBy = $this->model->sortForumBy($curForum['sort_by']);
4949

5050
// Can we or can we not post new topics?
51-
if (($curForum['post_topics'] == '' && User::can('topic.post')) || $curForum['post_topics'] == 1 || $isAdmmod) {
51+
if (($curForum['post_topics'] == '' && User::can('topic.post')) || $curForum['post_topics'] == '1' || $isAdmmod) {
5252
$postLink = "\t\t\t".'<p class="postlink conr"><a href="'.Router::pathFor('newTopic', ['fid' => $args['id']]).'">'.__('Post topic').'</a></p>'."\n";
5353
} else {
5454
$postLink = '';

featherbb/Controller/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function rules()
4848
{
4949
Hooks::fire('controller.index.rules');
5050

51-
if (ForumSettings::get('o_rules') == 0 || (User::get()->is_guest && !User::can('board.read') && ForumSettings::get('o_regs_allow') == 0)) {
51+
if (ForumSettings::get('o_rules') == '0' || (User::get()->is_guest && !User::can('board.read') && ForumSettings::get('o_regs_allow') == '0')) {
5252
throw new Error(__('Bad request'), 404);
5353
}
5454

featherbb/Controller/Install.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function run()
149149
])->addTemplate('@forum/install')->display(false);
150150
} else {
151151
$data['style'] = $this->defaultStyle;
152-
$data['avatars'] = in_array(strtolower(@ini_get('file_uploads')), ['on', 'true', 1]) ? 1 : 0;
152+
$data['avatars'] = in_array(strtolower(@ini_get('file_uploads')), ['on', 'true', '1']) ? 1 : 0;
153153
return $this->createConfig($data);
154154
}
155155
} else {

featherbb/Controller/Post.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ public function newPost($req, $res, $args)
8585
$isAdmmod = (User::isAdmin() || (User::isAdminMod() && array_key_exists(User::get()->username, $modsArray))) ? true : false;
8686

8787
// Do we have permission to post?
88-
if ((($args['tid'] && (($curPosting['post_replies'] == '' && !User::can('topic.reply')) || $curPosting['post_replies'] == 0)) ||
89-
($args['fid'] && (($curPosting['post_topics'] == '' && !User::can('topic.post')) || $curPosting['post_topics'] == 0)) ||
90-
(isset($curPosting['closed']) && $curPosting['closed'] == 1)) &&
88+
if ((($args['tid'] && (($curPosting['post_replies'] == '' && !User::can('topic.reply')) || $curPosting['post_replies'] == '0')) ||
89+
($args['fid'] && (($curPosting['post_topics'] == '' && !User::can('topic.post')) || $curPosting['post_topics'] == '0')) ||
90+
(isset($curPosting['closed']) && $curPosting['closed'] == '1')) &&
9191
!$isAdmmod) {
9292
throw new Error(__('No permission'), 403);
9393
}
@@ -114,7 +114,7 @@ public function newPost($req, $res, $args)
114114
$new = $this->model->reply($post, $args['tid'], $curPosting, $isSubscribed);
115115

116116
// Should we send out notifications?
117-
if (ForumSettings::get('o_topic_subscriptions') == 1) {
117+
if (ForumSettings::get('o_topic_subscriptions') == '1') {
118118
$this->model->sendNotificationsReply($args['tid'], $curPosting, $new['pid'], $post);
119119
}
120120
}
@@ -124,7 +124,7 @@ public function newPost($req, $res, $args)
124124
$new = $this->model->insertTopic($post, $args['fid']);
125125

126126
// Should we send out notifications?
127-
if (ForumSettings::get('o_forum_subscriptions') == 1) {
127+
if (ForumSettings::get('o_forum_subscriptions') == '1') {
128128
$this->model->sendNotificationsNewTopic($post, $curPosting, $new['tid']);
129129
}
130130
}
@@ -178,7 +178,7 @@ public function newPost($req, $res, $args)
178178
$checkboxes = $this->model->getCheckboxes($args['fid'], $isAdmmod, $isSubscribed);
179179

180180
// Check to see if the topic review is to be displayed
181-
if ($args['tid'] && ForumSettings::get('o_topic_review') != 0) {
181+
if ($args['tid'] && ForumSettings::get('o_topic_review') != '0') {
182182
$postData = $this->model->review($args['tid']);
183183
} else {
184184
$postData = '';
@@ -220,7 +220,7 @@ public function delete($req, $res, $args)
220220
// Fetch some information about the post, the topic and the forum
221221
$curPost = $this->model->getInfoDelete($args['id']);
222222

223-
if (ForumSettings::get('o_censoring') == 1) {
223+
if (ForumSettings::get('o_censoring') == '1') {
224224
$curPost['subject'] = Utils::censor($curPost['subject']);
225225
}
226226

@@ -234,7 +234,7 @@ public function delete($req, $res, $args)
234234
if ((!User::can('post.delete') ||
235235
(!User::can('topic.delete') && $isTopicPost) ||
236236
$curPost['poster_id'] != User::get()->id ||
237-
$curPost['closed'] == 1) &&
237+
$curPost['closed'] == '1') &&
238238
!$isAdmmod) {
239239
throw new Error(__('No permission'), 403);
240240
}
@@ -271,13 +271,13 @@ public function editpost($req, $res, $args)
271271

272272
$canEditSubject = $args['id'] == $curPost['first_post_id'];
273273

274-
if (ForumSettings::get('o_censoring') == 1) {
274+
if (ForumSettings::get('o_censoring') == '1') {
275275
$curPost['subject'] = Utils::censor($curPost['subject']);
276276
$curPost['message'] = Utils::censor($curPost['message']);
277277
}
278278

279279
// Do we have permission to edit this post?
280-
if ((!User::can('post.edit') || $curPost['poster_id'] != User::get()->id || $curPost['closed'] == 1) && !$isAdmmod) {
280+
if ((!User::can('post.edit') || $curPost['poster_id'] != User::get()->id || $curPost['closed'] == '1') && !$isAdmmod) {
281281
throw new Error(__('No permission'), 403);
282282
}
283283

@@ -340,7 +340,7 @@ public function report($req, $res, $args)
340340
// Fetch some info about the post, the topic and the forum
341341
$curPost = $this->model->getInfoReport($args['id']);
342342

343-
if (ForumSettings::get('o_censoring') == 1) {
343+
if (ForumSettings::get('o_censoring') == '1') {
344344
$curPost['subject'] = Utils::censor($curPost['subject']);
345345
}
346346

featherbb/Controller/Profile.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function display($req, $res, $args)
150150

151151
View::addTemplate('profile/menu.php', 5)->addTemplate('@forum/profile/section_personal')->display();
152152
} elseif ($args['section'] == 'personality') {
153-
if (ForumSettings::get('o_avatars') == 0 && ForumSettings::get('o_signatures') == 0) {
153+
if (ForumSettings::get('o_avatars') == '0' && ForumSettings::get('o_signatures') == '0') {
154154
throw new Error(__('Bad request'), 404);
155155
}
156156

@@ -293,7 +293,7 @@ public function action($req, $res, $args)
293293
]
294294
)->addTemplate('@forum/profile/change_mail')->display();
295295
} elseif ($args['action'] == 'upload_avatar' || $args['action'] == 'upload_avatar2') {
296-
if (ForumSettings::get('o_avatars') == 0) {
296+
if (ForumSettings::get('o_avatars') == '0') {
297297
throw new Error(__('Avatars disabled'), 400);
298298
}
299299

featherbb/Controller/Register.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function display($req, $res, $args)
4545

4646
// Display an error message if new registrations are disabled
4747
// If $_REQUEST['username'] or $_REQUEST['password'] are filled, we are facing a bot
48-
if (ForumSettings::get('o_regs_allow') == 0 || Input::post('username') || Input::post('password')) {
48+
if (ForumSettings::get('o_regs_allow') == '0' || Input::post('username') || Input::post('password')) {
4949
throw new Error(__('No new regs'), 403);
5050
}
5151

@@ -90,11 +90,11 @@ public function rules($req, $res, $args)
9090
}
9191

9292
// Display an error message if new registrations are disabled
93-
if (ForumSettings::get('o_regs_allow') == 0) {
93+
if (ForumSettings::get('o_regs_allow') == '0') {
9494
throw new Error(__('No new regs'), 403);
9595
}
9696

97-
if (ForumSettings::get('o_rules') != 1) {
97+
if (ForumSettings::get('o_rules') != '1') {
9898
return Router::redirect(Router::pathFor('register'));
9999
}
100100

featherbb/Controller/Topic.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function display($req, $res, $args)
8181
// Generate paging links
8282
$pagingLinks = '<span class="pages-label">'.__('Pages').' </span>'.Url::paginate($numPages, $p, 'topic/'.$args['id'].'/'.$urlTopic.'/#');
8383

84-
if (ForumSettings::get('o_censoring') == 1) {
84+
if (ForumSettings::get('o_censoring') == '1') {
8585
$curTopic['subject'] = Utils::censor($curTopic['subject']);
8686
}
8787

@@ -257,7 +257,7 @@ public function moderate($req, $res, $args)
257257
User::getPref('disp.posts') = $curTopic['num_replies'] + 1;
258258
}*/
259259

260-
if (ForumSettings::get('o_censoring') == 1) {
260+
if (ForumSettings::get('o_censoring') == '1') {
261261
$curTopic['subject'] = Utils::censor($curTopic['subject']);
262262
}
263263

0 commit comments

Comments
 (0)