pupupu

simple static CMS for crappy servers
git clone https://git.ce9e.org/pupupu.git

commit
7f6ed770e59138235b9abc5262a9e1f5588be185
parent
6e358992999edf12d636d2c7cf17f174dda5eddf
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2018-10-21 09:14
rm ensureTrailingSlash

Diffstat

M index.php 16 ----------------

1 files changed, 0 insertions, 16 deletions


diff --git a/index.php b/index.php

@@ -302,20 +302,6 @@ class Pupupu
  302   302     }
  303   303 }
  304   304 
  305    -1 function ensureTrailingSlash()
  306    -1 {
  307    -1     $parts = explode('?', $_SERVER['REQUEST_URI']);
  308    -1     if (substr($parts[0], -9) === 'index.php') {
  309    -1         $parts[0] = substr($parts[0], 0, -9);
  310    -1         header('Location: ' . implode('?', $parts), true, 301);
  311    -1         die();
  312    -1     } elseif (substr($parts[0], -1) !== '/') {
  313    -1         $parts[0] = $parts[0] . '/';
  314    -1         header('Location: ' . implode('?', $parts), true, 301);
  315    -1         die();
  316    -1     }
  317    -1 }
  318    -1 
  319   305 function pagesView($pupupu, $twig)
  320   306 {
  321   307     echo $twig->render('pages.html', array(
@@ -415,8 +401,6 @@ function errorView($pupupu, $twig, $error)
  415   401 $pupupu = new Pupupu('..', '..', '..');
  416   402 
  417   403 if (isset($_SERVER['REQUEST_METHOD'])) {
  418    -1     ensureTrailingSlash();
  419    -1 
  420   404     $loader = new Twig_Loader_Filesystem('templates');
  421   405     $twig = new Twig_Environment($loader);
  422   406     $twig->addFilter(new Twig_Filter('trans', 'trans'));