Skip to content

Commit

Permalink
Merge pull request #11955 from aembler/misc-fixes-022024
Browse files Browse the repository at this point in the history
Miscellaneous fixes for PHP 8 compatibility
  • Loading branch information
aembler committed Feb 20, 2024
2 parents 93c9a8b + d5e459b commit 1e3b522
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion concrete/attributes/date_time/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,11 @@ public function validateForm($data)
if ($this->akDateDisplayMode === null) {
$this->load();
}
return $data['value'] != '';
if (isset($data['value']) && $data['value'] != '') {
return true;
} else {
return false;
}
}

public function search()
Expand Down
2 changes: 1 addition & 1 deletion concrete/blocks/calendar_event/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public function getOccurrence()
$results = $list->getResults();
}

return $results[0];
return $results[0] ?? null;
}
if ($this->request->query->has('occurrenceID') && $this->mode == 'R') {
// request mode
Expand Down
2 changes: 2 additions & 0 deletions concrete/blocks/survey/controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class Controller extends BlockController implements UsesFeatureInterface

public $customMessage;

public $cID;

public $requiresRegistration = false;
/**
* Used for localization. If we want to localize the name/description we have to include this.
Expand Down
4 changes: 4 additions & 0 deletions concrete/controllers/single_page/download_file.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ public function view_inline($fID = 0)
}
}

$this->set('fID', $fID); // ensure $fID is set to something for invalid requests

if ($this->app->make('helper/validation/numbers')->integer($fID, 1)) {
$file = File::getByID($fID);

Expand Down Expand Up @@ -208,6 +210,8 @@ public function submit_password($fID = 0)
}
}

$this->set('fID', $fID); // ensure $fID is set to something for invalid requests

if ($this->app->make('helper/validation/numbers')->integer($fID, 1)) {
$f = File::getByID($fID);

Expand Down

0 comments on commit 1e3b522

Please sign in to comment.