summaryrefslogtreecommitdiff
path: root/model/Image.php
diff options
context:
space:
mode:
Diffstat (limited to 'model/Image.php')
-rw-r--r--model/Image.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/model/Image.php b/model/Image.php
index ac05f24..793bd8d 100644
--- a/model/Image.php
+++ b/model/Image.php
@@ -3,7 +3,6 @@
3 3
4class Image 4class Image
5{ 5{
6 private const MAX_WEIGHT = 2000000; // à adapter au php.ini
7 private $page; 6 private $page;
8 private $ajax; // vaut true avec le ckeditor 7 private $ajax; // vaut true avec le ckeditor
9 public $path; 8 public $path;
@@ -26,10 +25,12 @@ class Image
26 25
27 public function upload() 26 public function upload()
28 { 27 {
28 global $maxWeight;
29
29 // traitement et enregistrement de l'image 30 // traitement et enregistrement de l'image
30 if (isset($_FILES['upload']) AND $_FILES['upload']['error'] == 0) // 0 signifie ok 31 if (isset($_FILES['upload']) AND $_FILES['upload']['error'] == 0) // 0 signifie ok
31 { 32 {
32 if ($_FILES['upload']['size'] <= self::MAX_WEIGHT) 33 if ($_FILES['upload']['size'] <= $maxWeight)
33 { 34 {
34 $this->pathInfos = pathinfo($_FILES['upload']['name']); 35 $this->pathInfos = pathinfo($_FILES['upload']['name']);
35 $extension = $this->pathInfos['extension']; 36 $extension = $this->pathInfos['extension'];