Comments (4)
Summary
- To get the proper cache options, Kirby tries to get the index url
- For that it wants to create the current Uri object via
Uri::current()
- That takes the request url as main parameter for the constructor https://github.com/getkirby/kirby/blob/main/src/Http/Uri.php#L214
- Then in the constructor
parse_url
fails as it cannot handle the parameter notation in the URL https://github.com/getkirby/kirby/blob/main/src/Http/Uri.php#L91 - And the Kirby crashes because in subsequent lines we assume that
$props
always is an array, while now it isfalse
Pinging @bastianallgeier @lukasbestle for ideas as you have a better insight on the Http classes, I think.
from kirby.
Am I correct that this only happens if Kirby's url
option was configured without a host (e.g. as 'url' => '/'
)?
But the underlying bug seems to be in Uri::current()
or actually in the Uri
constructor. Maybe we could solve it there by adding a fake host for non-absolute URLs and removing the injected data from the array that parse_url()
returns again. We do a similar thing in the Environment
class:
kirby/src/Http/Environment.php
Lines 605 to 609 in 6b7ac66
from kirby.
Those lines form the Environment class sound like exactly what's needed here as well.
from kirby.
This sounds kinda familiar. Not sure if itβs really helpful here, but I fixed a similar issue in the library that I use for my HTML minification plugin a while ago. See hexydec/htmldoc#8
Am I correct that this only happens if Kirby's url option was configured without a host (e.g. as 'url' => '/')?
Exactly. As noted on php.net regarding parse_url()
:
This function may not give correct results for relative or invalid URLs [...]
and
This function is intended specifically for the purpose of parsing URLs and not URIs.
from kirby.
Related Issues (20)
- `<k-table>`: problems with case-sensitive matching of column index
- Star in blueprint title error
- textarea element is missing some padding when used as a Block in a Layout field.
- Console error when small screens
- System view: too long server name HOT 3
- `$file->srcset()` includes upscaled image sizes HOT 1
- Language permissions not working HOT 1
- Writer field overwritten with cached values from nested children HOT 1
- Writer field content deleted, when renaming page slug HOT 4
- Changing the sort number of listed pages will cause recreation of image source sets HOT 6
- Duplicate content when appending `.html` to page URLs HOT 5
- URLs of link fields are not truncated in table layout columns
- Image thumbs: persisting jobs files HOT 5
- [Panel] Dragging a file from a file section into a writer field stores the panel file url HOT 1
- [Panel] Long page title pushes the prev/next page navigation out of view HOT 3
- Resize/crop/thumb functions see longest size of images as width HOT 5
- [Panel] Switching Languages triggers revert / save HOT 1
- Use `slugs.maxlength` when generating slugs
- `convert` command deprecated
- Slower navigation requests still go through even if already navigated elsewhere
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kirby.