diff --git a/.vscode/extensions.json b/.vscode/extensions.json index f0119e4a..bf08864f 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,7 +1,7 @@ { "recommendations": [ "bmewburn.vscode-intelephense-client", - "felixfbecker.php-debug", + "xdebug.php-debug", "shevaua.phpcs" ] } diff --git a/app/controller/files.php b/app/controller/files.php index 60b8bc64..8b8fe1cb 100644 --- a/app/controller/files.php +++ b/app/controller/files.php @@ -142,11 +142,20 @@ public function thumb($f3, $params) $c1 = imagecolorallocate($frame, 243, 243, 243); imagefilledrectangle($frame, $ox - $fb, $oy - $fb, $size - $ox + $fb, $size - $oy + $fb, $c1); $c2 = imagecolorallocate($frame, 230, 230, 230); - imagefilledpolygon($frame, array( - $size - $ox + $fb, $oy - $fb, - $size - $ox + $fb, $size - $oy + $fb, - $ox - $fb, $size - $oy + $fb, - ), 3, $c2); + // This is an incredibly stupid way of deprecating a parameter, thanks PHP. + if (PHP_VERSION_ID >= 80000) { + imagefilledpolygon($frame, array( + $size - $ox + $fb, $oy - $fb, + $size - $ox + $fb, $size - $oy + $fb, + $ox - $fb, $size - $oy + $fb, + ), $c2); + } else { + imagefilledpolygon($frame, array( + $size - $ox + $fb, $oy - $fb, + $size - $ox + $fb, $size - $oy + $fb, + $ox - $fb, $size - $oy + $fb, + ), 3, $c2); + } } // Copy thumbnail onto frame diff --git a/app/helper/view.php b/app/helper/view.php index 074bfebe..520b421a 100644 --- a/app/helper/view.php +++ b/app/helper/view.php @@ -22,6 +22,9 @@ public function __construct() */ public function parseText($str, $options = array(), $ttl = null) { + if ($str === null || $str === '') { + return ''; + } if ($options === null) { $options = array(); } @@ -238,6 +241,7 @@ protected function _parseEmoticons($str) */ protected function _parseTextile($str, $escape = true) { + error_reporting(E_ALL ^ E_DEPRECATED); // Temporarily ignore deprecations because this lib is incompatible $tex = new \Netcarver\Textile\Parser('html5'); $tex->setDimensionlessImages(true); $tex->setRestricted($escape); @@ -286,7 +290,7 @@ public function gravatar($email, $size = 80) $f3 = \Base::instance(); $rating = $f3->get("gravatar.rating") ? $f3->get("gravatar.rating") : "pg"; $default = $f3->get("gravatar.default") ? $f3->get("gravatar.default") : "mm"; - return "//gravatar.com/avatar/" . md5(strtolower($email)) . + return "https://gravatar.com/avatar/" . md5(strtolower($email ?? '')) . "?s=" . intval($size) . "&d=" . urlencode($default) . "&r=" . urlencode($rating); diff --git a/app/model/issue.php b/app/model/issue.php index 1c0027a2..b6e6d5fe 100644 --- a/app/model/issue.php +++ b/app/model/issue.php @@ -10,20 +10,20 @@ * @property int $type_id * @property string $name * @property string $description - * @property int $parent_id + * @property ?int $parent_id * @property int $author_id - * @property int $owner_id + * @property ?int $owner_id * @property int $priority - * @property float $hours_total - * @property float $hours_remaining - * @property float $hours_spent + * @property ?float $hours_total + * @property ?float $hours_remaining + * @property ?float $hours_spent * @property string $created_date - * @property string $closed_date - * @property string $deleted_date - * @property string $start_date - * @property string $due_date - * @property string $repeat_cycle - * @property int $sprint_id + * @property ?string $closed_date + * @property ?string $deleted_date + * @property ?string $start_date + * @property ?string $due_date + * @property ?string $repeat_cycle + * @property ?int $sprint_id */ class Issue extends \Model { @@ -302,7 +302,7 @@ protected function _saveUpdate(bool $notify = true): Issue\Update $importantChanges = 0; $importantFields = array('status', 'name', 'description', 'owner_id', 'priority', 'due_date'); foreach ($this->fields as $key => $field) { - if ($field["changed"] && rtrim($field["value"]) != rtrim($this->_getPrev($key))) { + if ($field["changed"] && rtrim($field["value"] ?? '') != rtrim($this->_getPrev($key) ?? '')) { $updateField = new \Model\Issue\Update\Field(); $updateField->issue_update_id = $update->id; $updateField->field = $key; @@ -537,7 +537,11 @@ public function hashState(): array { $result = $this->cast(); foreach ($result as &$value) { - $value = md5($value); + if ($value === null) { + $value = md5(''); + } else { + $value = md5($value); + } } return $result; } diff --git a/app/view/admin/config.html b/app/view/admin/config.html index 97521ac1..7794f7b6 100644 --- a/app/view/admin/config.html +++ b/app/view/admin/config.html @@ -176,7 +176,7 @@
Due {{ date("l, F j", strtotime(@item.due_date)) }}