$app = strip_tags(defaults($_REQUEST, 'source', ''));
$extid = strip_tags(defaults($_REQUEST, 'extid', ''));
$object = defaults($_REQUEST, 'object', '');
- $wall = intval(defaults($_REQUEST, 'wall', 1));
+
+ // Don't use "defaults" here. It would turn 0 to 1
+ if (!isset($_REQUEST['wall'])) {
+ $wall = 1;
+ } else {
+ $wall = $_REQUEST['wall'];
+ }
// Ensure that the user id in a thread always stay the same
if (!is_null($parent_user) && in_array($parent_user, [local_user(), 0])) {
// even if the post arrived via API we are considering that it
// originated on this site by default for determining relayability.
- $origin = intval(defaults($_REQUEST, 'origin', 1));
+ // Don't use "defaults" here. It would turn 0 to 1
+ if (!isset($_REQUEST['origin'])) {
+ $origin = 1;
+ } else {
+ $origin = $_REQUEST['origin'];
+ }
$notify_type = ($parent ? 'comment-new' : 'wall-new');
$commands[$key] = ['table' => $table, 'conditions' => $conditions];
- $cascade = defaults($options, 'cascade', true);
+ // Don't use "defaults" here, since it would set "false" to "true"
+ if (isset($options['cascade'])) {
+ $cascade = $options['cascade'];
+ } else {
+ $cascade = true;
+ }
// To speed up the whole process we cache the table relations
if ($cascade && count(self::$relation) == 0) {
{{* The hidden input fields which submit important values with the post *}}
<input type="hidden" name="jot" value="{{$jot}}" />
+ <input type="hidden" name="wall" value="{{$wall}}" />
<input type="hidden" name="post_type" value="{{$posttype}}" />
<input type="hidden" name="profile_uid" value="{{$profile_uid}}" />
<input type="hidden" name="return" value="{{$return_path}}" />
<input name="category" id="jot-category" type="text" placeholder="{{$placeholdercategory}}" title="{{$placeholdercategory}}" value="{{$category}}" class="jothidden" style="display:none" />
{{/if}}
<div id="character-counter" class="grey jothidden"></div>
-
-
-
<input type="hidden" name="wall" value="{{$wall}}" />
<input type="hidden" name="post_type" value="{{$posttype}}" />
<input type="hidden" name="profile_uid" value="{{$profile_uid}}" />