summaryrefslogtreecommitdiff
path: root/core/helpers/item.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-05-16 22:27:32 +0000
committerBharat Mediratta <bharat@menalto.com>2009-05-16 22:27:32 +0000
commit8f11bce904d188b29e180a11113b51fdfade60b0 (patch)
tree84c35b64a730dc08f959038e3fa8f782df305c01 /core/helpers/item.php
parent6ceb10424b4dc1bba6cfc1bd3a17c4428ae9c98c (diff)
Don't allow photos, albums or movies to have a trailing period to avoid
security problems. Ref http://dev.kohanaphp.com/issues/684). This plus r20823 resolves ticket #248.
Diffstat (limited to 'core/helpers/item.php')
-rw-r--r--core/helpers/item.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/helpers/item.php b/core/helpers/item.php
index bd54f2b1..8ff09535 100644
--- a/core/helpers/item.php
+++ b/core/helpers/item.php
@@ -78,4 +78,10 @@ class item_Core {
$input->add_error("no_slashes", 1);
}
}
+
+ static function validate_no_trailing_period($input) {
+ if (rtrim($input->value, ".") !== $input->value) {
+ $input->add_error("no_trailing_period", 1);
+ }
+ }
} \ No newline at end of file