Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Colon in url

Started by Muut Archive 11 years ago · 5 replies · 525 views
11 years ago

Well I can reproduce it, and yes, I can see extensive comments on this on the net. Unfortunately this is not a trivial thing to change. it's somewhat embedded in Grav and a change could impact lots of Grav installations. I looked at the ability to have this configurable, but even that is not trivial a thing. I'm going to continue to look for workarounds however...

11 years ago

Many thanks! Here is my list of modifications to replace colon (:) with semicolon (;) as separator in Grav v0.9.17
system\src\Grav\Common\Uri.php line 81 - 86

PHP
    if (strpos($uri, ';')) {
        $bits = explode('/', $uri);
        $path = array();
        foreach ($bits as $bit) {
            if (strpos($bit, ';') !== false) {
                $param = explode(';', $bit);

user\plugins\pagination\classes\paginationhelper.php line 53

PHP
        $this->items[$x] = new PaginationPage($x, '/page;'.$x);

And in the twig file of my theme:
user hemes
otepad emplates\partials\article.html.twig line 27
{% for tag in post.taxonomy.tag %}<span class="post-tag-{{tag}}"><a href="{{ home.url }}/tag;{{ tag }}">{{ tag }}</a></span>{%if not loop.last %} {% endif %},{% endfor %}

There maybe more but it works for 'page:' and 'tag:'

11 years ago

Ok, I think I have a good solution for this. Basically i've made this separator configurable. It will default to : as this works for most scenarios, but you can change it to ; or ~, or whatever char works best for you. unfortunately this means a bunch of plugins and themes will get updated to provide support for the dynamic variable. However, because we are defaulting to : still, it should be a pretty painless experience.

11 years ago

I remember this bug, it's for windows only and working only in the first segment, if you put the grav site inside a folder, example you have

TXT
http://localhost/grav/foo:bar

this not get any error to apache windows.
I have already investigate in the past for this choice to use a vagrant machine and remove all the possible bugs into windows machine :P

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1322 9 years ago
Archive · by Muut Archive, 9 years ago
2 917 9 years ago
Archive · by Muut Archive, 9 years ago
2 4048 9 years ago
Archive · by Muut Archive, 9 years ago
1 2922 9 years ago
Archive · by Muut Archive, 9 years ago
3 1106 9 years ago