Skip to content

Commit

Permalink
Merge branch 'release/1.10.48'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhukster committed Oct 28, 2024
2 parents 5a64293 + 1527dcf commit 6726d13
Show file tree
Hide file tree
Showing 12 changed files with 3,423 additions and 5,050 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# v1.10.48
## 10/28/2024

1. [](#improved)
* Treat AVIF as image when inserting / drag & dropping
* PHP 8.4 fixes - Implicitly nullable parameter declarations deprecate

# v1.10.47
## 10/22/2024

Expand Down
2 changes: 1 addition & 1 deletion blueprints.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Admin Panel
slug: admin
type: plugin
version: 1.10.47
version: 1.10.48
description: Adds an advanced administration panel to manage your site
icon: empire
author:
Expand Down
2 changes: 1 addition & 1 deletion classes/plugin/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ public function data($type, array $post = [])
* @return object
* @throws \RuntimeException
*/
public function getConfigurationData($type, array $post = null)
public function getConfigurationData($type, ?array $post = null)
{
static $data = [];

Expand Down
4 changes: 2 additions & 2 deletions classes/plugin/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class AdminController extends AdminBaseController
* @param array|null $post
* @return void
*/
public function initialize(Grav $grav = null, $view = null, $task = null, $route = null, $post = null)
public function initialize(?Grav $grav = null, $view = null, $task = null, $route = null, $post = null)
{
$this->grav = $grav;
$this->admin = $this->grav['admin'];
Expand Down Expand Up @@ -2717,7 +2717,7 @@ protected function getLevelListing($data)
* @param PageInterface|null $page
* @return Media|null
*/
public function getMedia(PageInterface $page = null)
public function getMedia(?PageInterface $page = null)
{
$page = $page ?? $this->admin->page($this->route);
if (!$page) {
Expand Down
8 changes: 4 additions & 4 deletions classes/plugin/Controllers/AbstractController.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function getRequest(): ServerRequestInterface
* @param mixed $default
* @return mixed
*/
public function getPost(string $name = null, $default = null)
public function getPost(?string $name = null, $default = null)
{
$body = $this->request->getParsedBody();

Expand All @@ -167,7 +167,7 @@ public function isFormSubmit(): bool
* @param string|null $type
* @return FormInterface
*/
public function getForm(string $type = null): FormInterface
public function getForm(?string $type = null): FormInterface
{
$object = $this->getObject();
if (!$object) {
Expand Down Expand Up @@ -227,7 +227,7 @@ public function createDisplayResponse(): ResponseInterface
* @param int $code
* @return Response
*/
public function createHtmlResponse(string $content, int $code = null): ResponseInterface
public function createHtmlResponse(string $content, ?int $code = null): ResponseInterface
{
return new Response($code ?: 200, [], $content);
}
Expand Down Expand Up @@ -255,7 +255,7 @@ public function createJsonResponse(array $content): ResponseInterface
* @param int $code
* @return Response
*/
public function createRedirectResponse(string $url, int $code = null): ResponseInterface
public function createRedirectResponse(string $url, ?int $code = null): ResponseInterface
{
if (null === $code || $code < 301 || $code > 307) {
$code = $this->grav['config']->get('system.pages.redirect_default_code', 302);
Expand Down
6 changes: 3 additions & 3 deletions classes/plugin/Controllers/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ abstract protected function getFormSubmitMethod(string $name): callable;
* @param string|null $lang
* @return string
*/
public function getAdminUrl(string $route, string $lang = null): string
public function getAdminUrl(string $route, ?string $lang = null): string
{
/** @var Pages $pages */
$pages = $this->grav['pages'];
Expand All @@ -131,7 +131,7 @@ public function getAdminUrl(string $route, string $lang = null): string
* @param string|null $lang
* @return string
*/
public function getAbsoluteAdminUrl(string $route, string $lang = null): string
public function getAbsoluteAdminUrl(string $route, ?string $lang = null): string
{
/** @var Pages $pages */
$pages = $this->grav['pages'];
Expand Down Expand Up @@ -319,7 +319,7 @@ protected function createPage(string $template): PageInterface
* @param int|null $code
* @return ResponseInterface
*/
protected function createRedirectResponse(string $url = null, int $code = null): ResponseInterface
protected function createRedirectResponse(?string $url = null, ?int $code = null): ResponseInterface
{
$request = $this->getRequest();

Expand Down
4 changes: 2 additions & 2 deletions classes/plugin/Controllers/Login/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function displayForgot(): ResponseInterface
* @param string|null $token
* @return ResponseInterface
*/
public function displayReset(string $username = null, string $token = null): ResponseInterface
public function displayReset(?string $username = null, ?string $token = null): ResponseInterface
{
if ('' === (string)$username || '' === (string)$token) {
$this->setMessage($this->translate('PLUGIN_ADMIN.RESET_INVALID_LINK'), 'error');
Expand Down Expand Up @@ -318,7 +318,7 @@ public function taskTwofa(): ResponseInterface
* @param string|null $token
* @return ResponseInterface
*/
public function taskReset(string $username = null, string $token = null): ResponseInterface
public function taskReset(?string $username = null, ?string $token = null): ResponseInterface
{
$this->page = $this->createPage('reset');
$this->form = $this->getForm('admin-login-reset');
Expand Down
2 changes: 1 addition & 1 deletion classes/plugin/Twig/AdminTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function cloneFunc($obj)
return clone $obj;
}

public function adminRouteFunc(string $route = '', string $languageCode = null)
public function adminRouteFunc(string $route = '', ?string $languageCode = null)
{
/** @var Admin $admin */
$admin = Grav::instance()['admin'];
Expand Down
2 changes: 1 addition & 1 deletion themes/grav/app/forms/fields/filepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default class FilePickerField {

let renderOption = function renderOption(item, escape) {
let image = '';
if (imagesPreview && folder && (!item.status || item.status === 'available') && item.name.match(/\.(jpg|jpeg|png|gif|webp)$/i)) {
if (imagesPreview && folder && (!item.status || item.status === 'available') && item.name.match(/\.(jpg|jpeg|png|gif|webp|avif)$/i)) {
// const fallback2x = insertTextAt(`${config.base_url_relative}/../${folder}/${item.name}`, -4, '@2x');
// const fallback3x = insertTextAt(`${config.base_url_relative}/../${folder}/${item.name}`, -4, '@3x');
const source = thumbs[item.name] || `${config.base_url_relative}/../${folder}/${item.name}`;
Expand Down
2 changes: 1 addition & 1 deletion themes/grav/app/forms/fields/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ export function UriToMarkdown(uri) {

const title = uri.split('.').slice(0, -1).join('.');

return uri.match(/\.(jpe?g|png|gif|svg|webp|mp4|webm|ogv|mov)$/i) ? `![${title}](${uri} "${title}")` : `[${decodeURI(uri)}](${uri})`;
return uri.match(/\.(jpe?g|png|gif|svg|webp|avif|mp4|webm|ogv|mov)$/i) ? `![${title}](${uri} "${title}")` : `[${decodeURI(uri)}](${uri})`;
}

let instances = [];
Expand Down
Loading

0 comments on commit 6726d13

Please sign in to comment.