Fixed error when trying to use the forum posting form.
This commit is contained in:
parent
ebabb19998
commit
cb40fdc7c4
2 changed files with 5 additions and 3 deletions
|
@ -43,7 +43,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="container forum__post js-forum-posting" style="{{ posting_post.poster_colour|default(current_user.colour.raw)|html_colour('--accent-colour') }}">
|
<div class="container forum__post js-forum-posting" style="{{ posting_post.poster_colour|default(current_user.colour)|html_colour('--accent-colour') }}">
|
||||||
<div class="forum__post__info">
|
<div class="forum__post__info">
|
||||||
<div class="forum__post__info__background"></div>
|
<div class="forum__post__info__background"></div>
|
||||||
<div class="forum__post__info__content">
|
<div class="forum__post__info__content">
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
use \Index\Colour\Colour;
|
||||||
|
|
||||||
function array_test(array $array, callable $func): bool {
|
function array_test(array $array, callable $func): bool {
|
||||||
foreach($array as $value)
|
foreach($array as $value)
|
||||||
if(!$func($value))
|
if(!$func($value))
|
||||||
|
@ -105,8 +107,8 @@ function render_info(?string $message, int $httpCode, string $template = 'errors
|
||||||
return \Misuzu\Template::renderRaw(sprintf($template, $httpCode));
|
return \Misuzu\Template::renderRaw(sprintf($template, $httpCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
function html_colour(?int $colour, $attribs = '--user-colour'): string {
|
function html_colour(int|null|Colour $colour, $attribs = '--user-colour'): string {
|
||||||
$colour = (string)\Index\Colour\Colour::fromMisuzu($colour ?? 0x40000000);
|
$colour = (string)($colour instanceof Colour ? $colour : Colour::fromMisuzu($colour ?? 0x40000000));
|
||||||
|
|
||||||
if(is_string($attribs))
|
if(is_string($attribs))
|
||||||
$attribs = [ $attribs => '%s' ];
|
$attribs = [ $attribs => '%s' ];
|
||||||
|
|
Loading…
Reference in a new issue