Skip to content

Commit

Permalink
Merge pull request #183 from pentium10/master
Browse files Browse the repository at this point in the history
improvements for php8.1
  • Loading branch information
pentium10 authored Feb 4, 2022
2 parents 9876bd0 + 4a00a87 commit 6523c20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions lib/include.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ protected function _postDelete() {
$this->_globalVar['tube'] = null;
}
header(
sprintf('Location: ./?server=%s&tube=%s', $this->_globalVar['server'], urlencode($this->_globalVar['tube'])));
sprintf('Location: ./?server=%s&tube=%s', $this->_globalVar['server'], urlencode($this->_globalVar['tube'] ?? '')));
exit();
}

Expand Down Expand Up @@ -689,7 +689,7 @@ protected function _actionSearch() {

foreach ($states as $state) {
$jobList[$state] = $this->findJobsByState($GLOBALS['tube'], $state, $searchStr, $limit);
$jobList['total']+=count($jobList[$state]);
$jobList['total'] += count($jobList[$state]);
}

$this->searchResults = $jobList;
Expand Down Expand Up @@ -741,8 +741,8 @@ private function findJobsByState($tube, $state, $searchStr, $limit = 25) {
if ($job) {
$jobStats = $this->interface->_client->statsJob($job);
if ($jobStats->tube === $tube &&
$jobStats->state === $state &&
strpos($job->getData(), $searchStr) !== false
$jobStats->state === $state &&
strpos($job->getData(), $searchStr) !== false
) {
$jobList[$id] = $job;
$added++;
Expand Down
4 changes: 2 additions & 2 deletions lib/tpl/currentTubeJobsShowcase.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
<?php
if (in_array($key, array('age', 'delay', 'time-left'), true)) {
$days = floor($value / 86400);
$hours = floor($value / 3600 % 24);
$minutes = floor($value / 60 % 60);
$hours = floor($value / 3600) % 24;
$minutes = floor($value / 60) % 60;
$seconds = floor($value % 60);
echo $days > 0 ? 'days: ' . $days . '<br>' : '';
echo $hours > 0 ? 'hours: ' . $hours . '<br>' : '';
Expand Down

0 comments on commit 6523c20

Please sign in to comment.