diff --git a/404.php b/404.php
index f70e3e2..4ee1e9e 100644
--- a/404.php
+++ b/404.php
@@ -15,7 +15,29 @@
Sudoku non trouvé
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "/>
+ /thumbnail.php?size=200"/>
+
+
+
+
+ "/>
diff --git a/classes.php b/classes.php
index 6bbe3b8..e06d8d8 100644
--- a/classes.php
+++ b/classes.php
@@ -85,16 +85,18 @@
}
function containsDuplicates() {
- foreach(array_merge($this->rows, $this->columns, $this->regions) as $area) {
- $unknownBoxes = array_filter($area, "isUnknown");
- foreach($unknownBoxes as $box1) {
- foreach($unknownBoxes as $box2) {
- if (($box1 !== $box2) && ($box1->value == $box2->value)) {
- return true;
+ foreach(array($this->rows, $this->columns, $this->regions) as $areas) {
+ foreach ($areas as $area) {
+ $unknownBoxes = array_filter($area, "isKnown");
+ foreach($unknownBoxes as $box1) {
+ foreach($unknownBoxes as $box2) {
+ if (($box1 !== $box2) && ($box1->value == $box2->value)) {
+ return true;
+ }
}
}
+ return false;
}
- return false;
}
}
diff --git a/manifest.json.php b/manifest.php
similarity index 73%
rename from manifest.json.php
rename to manifest.php
index 33cacb8..6e43c5b 100644
--- a/manifest.json.php
+++ b/manifest.php
@@ -1,6 +1,6 @@
",
"icons": [{
- "src": "thumbnail.png?size=48",
+ "src": "thumbnail.php?size=48",
"sizes": "48x48",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=72",
+ "src": "thumbnail.php?size=72",
"sizes": "72x72",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=96",
+ "src": "thumbnail.php?size=96",
"sizes": "96x96",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=144",
+ "src": "thumbnail.php?size=144",
"sizes": "144x144",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=168",
+ "src": "thumbnail.php?size=168",
"sizes": "168x168",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=192",
+ "src": "thumbnail.php?size=192",
"sizes": "192x192",
"type": "image/png"
}]
@@ -78,27 +78,27 @@
"description": "Grille de sudoku vierge",
"url": ".................................................................................",
"icons": [{
- "src": "thumbnail.png?size=48",
+ "src": "thumbnail.php?size=48",
"sizes": "48x48",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=72",
+ "src": "thumbnail.php?size=72",
"sizes": "72x72",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=96",
+ "src": "thumbnail.php?size=96",
"sizes": "96x96",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=144",
+ "src": "thumbnail.php?size=144",
"sizes": "144x144",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=168",
+ "src": "thumbnail.php?size=168",
"sizes": "168x168",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=192",
+ "src": "thumbnail.php?size=192",
"sizes": "192x192",
"type": "image/png"
}]
@@ -109,27 +109,27 @@
"description": "Nouvelle grille de sudoku",
"url": ".",
"icons": [{
- "src": "thumbnail.png?size=48",
+ "src": "thumbnail.php?size=48",
"sizes": "48x48",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=72",
+ "src": "thumbnail.php?size=72",
"sizes": "72x72",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=96",
+ "src": "thumbnail.php?size=96",
"sizes": "96x96",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=144",
+ "src": "thumbnail.php?size=144",
"sizes": "144x144",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=168",
+ "src": "thumbnail.php?size=168",
"sizes": "168x168",
"type": "image/png"
}, {
- "src": "thumbnail.png?size=192",
+ "src": "thumbnail.php?size=192",
"sizes": "192x192",
"type": "image/png"
}]
diff --git a/nginx-example.conf b/nginx-example.conf
index 5dda4bd..1ab6f16 100644
--- a/nginx-example.conf
+++ b/nginx-example.conf
@@ -7,7 +7,7 @@ location /sudoku/ {
index index.php;
- try_files $uri $uri/ @add-php-extention;
+ try_files $uri $uri/;
location ~ [^/]\.php(/|$) {
try_files $uri =404;
@@ -29,7 +29,3 @@ location /sudoku/ {
location ~ "^/sudoku/([1-9.]{81})$" {
rewrite "^/sudoku/([1-9.]{81})$" /sudoku/sudoku.php?grid=$1 last;
}
-
-location @add-php-extention {
- rewrite ^([^?#]*)(\?.*)?(#.*)?$ $1.php$2$3 last;
-}
diff --git a/service-worker.js.php b/service-worker.php
similarity index 98%
rename from service-worker.js.php
rename to service-worker.php
index 781afdc..779d131 100644
--- a/service-worker.js.php
+++ b/service-worker.php
@@ -1,6 +1,6 @@
Sudoku
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
"/>
- /thumbnail.png?size=200"/>
+ /thumbnail.php?size=200"/>
diff --git a/thumbnail.png.php b/thumbnail.php
similarity index 93%
rename from thumbnail.png.php
rename to thumbnail.php
index 912e416..ac93afe 100644
--- a/thumbnail.png.php
+++ b/thumbnail.php
@@ -1,10 +1,10 @@
$value) {
+ foreach(str_split($currentGrid) as $i => $value) {
if ($i % 3 == 0) $x++;
if ($i % 27 == 0) $y++;
if ($value == UNKNOWN) {
@@ -63,7 +63,7 @@
$x = $start + 1;
$y = $start + 1;
$boxSizeMinusTwo = $boxSize - 2;
- foreach(str_split($_SESSION["currentGrid"]) as $i => $value) {
+ foreach(str_split($currentGrid) as $i => $value) {
if ($value == UNKNOWN) {
$bgColor = $white;
} else {
@@ -98,7 +98,7 @@
$x = $start + 1;
$y = $start + 1;
$boxSizeMinusTwo = $boxSize - 2;
- foreach(str_split($_SESSION["currentGrid"]) as $i => $value) {
+ foreach(str_split($currentGrid) as $i => $value) {
if ($value == UNKNOWN) {
$bgColor = $white;
} else {