summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-06-15 14:46:37 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2013-06-15 14:46:37 +0200
commit6d184ad1b8b84ab31e342f539844e0dc5738423b (patch)
tree30f83a95825111c0e115e7ffdfafefd3d2713874
parentedffec1d698f0c65f4f50a11e1f35e39fc5b8a42 (diff)
Fix issue #89 : meilleure vérification des champs de formulaires (géré par Minz)
-rwxr-xr-xapp/models/RSSConfiguration.php4
-rw-r--r--lib/minz/Request.php7
2 files changed, 8 insertions, 3 deletions
diff --git a/app/models/RSSConfiguration.php b/app/models/RSSConfiguration.php
index 50dbd2555..6ebc30e8e 100755
--- a/app/models/RSSConfiguration.php
+++ b/app/models/RSSConfiguration.php
@@ -85,7 +85,7 @@ class RSSConfiguration extends Model {
$this->language = $value;
}
public function _postsPerPage ($value) {
- if (is_int (intval ($value))) {
+ if (is_int (intval ($value)) && $value > 0) {
$this->posts_per_page = $value;
} else {
$this->posts_per_page = 10;
@@ -120,7 +120,7 @@ class RSSConfiguration extends Model {
}
}
public function _oldEntries ($value) {
- if (is_int (intval ($value))) {
+ if (is_int (intval ($value)) && $value > 0) {
$this->old_entries = $value;
} else {
$this->old_entries = 3;
diff --git a/lib/minz/Request.php b/lib/minz/Request.php
index 507630b84..3463686bc 100644
--- a/lib/minz/Request.php
+++ b/lib/minz/Request.php
@@ -31,7 +31,12 @@ class Request {
}
public static function param ($key, $default = false) {
if (isset (self::$params[$key])) {
- return self::$params[$key];
+ $p = self::$params[$key];
+ if(is_array($p)) {
+ return array_map(htmlspecialchars, $p);
+ } else {
+ return htmlspecialchars($p);
+ }
} else {
return $default;
}