- commit
- 363862e50717edbcda3ce7d90aa6eaa507206235
- parent
- 095a64fc046874b0fc538e60376176e3f636294b
- Author
- Tobias Bengfort <tobias.bengfort@posteo.de>
- Date
- 2018-10-20 21:52
urlencode url parameters
Diffstat
| M | index.php | 3 | ++- |
| M | templates/files.html | 2 | +- |
| M | templates/pages.html | 2 | +- |
3 files changed, 4 insertions, 3 deletions
diff --git a/index.php b/index.php
@@ -336,7 +336,8 @@ function siteView($pupupu, $twig) 336 336 function pageView($pupupu, $twig) 337 337 { 338 338 if (isset($_GET['add'])) {339 -1 header("Location: ?path=${_GET['path']}/${_GET['add']}", true, 302);-1 339 $path = $_GET['path'] . '/' . $_GET['add']; -1 340 header('Location: ?path=' . urlencode($path), true, 302); 340 341 } else { 341 342 $path = validatePath($_GET['path']); 342 343
diff --git a/templates/files.html b/templates/files.html
@@ -13,7 +13,7 @@ 13 13 <a href="{{ file.url }}" target="_blank" class="file-list__main">{{ file.name }}</a> 14 14 {% else %} 15 15 <img src="static/folder.png" class="file-list__icon" alt="{{ 'folder'|trans }}">16 -1 <a href="?path=_files{{ file.path }}" class="file-list__main">{{ file.name }}/</a>-1 16 <a href="?path=_files{{ file.path|e('url') }}" class="file-list__main">{{ file.name }}/</a> 17 17 {% endif %} 18 18 19 19 {% if file.name != '..' %}
diff --git a/templates/pages.html b/templates/pages.html
@@ -3,7 +3,7 @@ 3 3 {% block main %} 4 4 <ul class="file-list"> 5 5 {% for path in pages %}6 -1 <li><a href="?path={{ path }}" class="file-list__main">-1 6 <li><a href="?path={{ path|e('url') }}" class="file-list__main"> 7 7 {{ path }}{% if '.' not in path %}/{% endif %} 8 8 </a></li> 9 9 {% endfor %}