@@ -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
0 commit comments