This commit is contained in:
2019-02-18 15:48:30 +01:00
parent 1d015448cd
commit c121381775
6 changed files with 34 additions and 40 deletions

View File

@ -36,26 +36,35 @@ Options All -Indexes
# lorsque qu'une url va correspondre a un fichier finissant par .php ou .html on interdit l'acces (retourne une erreur 403 (ensuite geré par notre ligne plus haut))
<FilesMatch ".*\.(php|html)$">
# Order Allow,Deny
# Deny from all
Require all denied
<IfVersion < 2.4>
Order Allow,Deny
Deny from all
</IfVersion>
<IfVersion >= 2.4>
Require all denied
</IfVersion/>
</FilesMatch>
# on donne l'autorisation d'acceder au fichier handler.php (sinon le site ne sera pas foncitonnel)
<FilesMatch "handler.php">
# Order Allow,Deny
# Allow from all
Require all granted
<IfVersion < 2.4>
Order Allow,Deny
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion/>
</FilesMatch>
# on donne acces au fichiers webmanifest et svg
<FilesMatch ".*\.(webmanifest|svg)$">
# Order Allow,Deny
# Allow from all
Require all granted
<IfVersion < 2.4>
Order Allow,Deny
Allow from all
</IfVersion>
<IfVersion >= 2.4>
Require all granted
</IfVersion/>
</FilesMatch>
# si le serveur apache a le module mod_deflate.c

View File

@ -31,7 +31,7 @@ if(sizeof(explode("/", $_GET["page"])) > 1) {
}
// $_get[page] = $_get[page][0]
$_GET['page'] = "/" . explode('/', $_GET['page'])[0];
$_GET['page'] = "/" . $_GET['page'];
// si len $_get[page] > 1 (mot ou autre) on rajoute le slash de fin
if(strlen($_GET['page']) > 1) {

View File

@ -18,7 +18,7 @@ $post = function () {
return file_get_contents("../html/post.html");
};
$router->addRoute("/^\/post\/" + $postCharacters + "+\/*$/", $post); // route "/post/*"
$router->addRoute("/^\/post\/" . $postCharacters . "+\/*$/", $post); // route "/post/*"
//page de recherche
$search = function () {
@ -31,4 +31,4 @@ $post = function() {
var_dump("tst");
};
$router->addRoute("/^\/post\/" + $postCharacters + "+\/edit\/*$/", $post);
$router->addRoute("/^\/post\/" . $postCharacters . "+\/edit\/*$/", $post);

View File

@ -283,21 +283,21 @@ while($lst = $list->item(0)) {
$tg = new $tgs($dom, $lst, false);
$tg->render();
var_dump("--------- 1 ---------");
for ($i=0; $i < $list->count(); $i++) {
var_dump($list->item($i)->getAttribute("type"));
}
echo (htmlspecialchars($dom->saveHTML()));
// var_dump("--------- 1 ---------");
// for ($i=0; $i < $list->count(); $i++) {
// var_dump($list->item($i)->getAttribute("type"));
// }
// echo (htmlspecialchars($dom->saveHTML()));
// var_dump($list[0]->parentNode->nodeName);
$lst->parentNode->removeChild($lst);
var_dump("--------- 2 ---------");
for ($i=0; $i < $list->count(); $i++) {
var_dump($list->item($i)->getAttribute("type"));
}
echo (htmlspecialchars($dom->saveHTML()));
// var_dump("--------- 2 ---------");
// for ($i=0; $i < $list->count(); $i++) {
// var_dump($list->item($i)->getAttribute("type"));
// }
// echo (htmlspecialchars($dom->saveHTML()));
$list = $dom->getElementsByTagName("tag");
}