[wolfcms] r345 committed - Fixed title validation issue - issue 61 - thanks axjezzy

1 view
Skip to first unread message

wol...@googlecode.com

unread,
Dec 2, 2010, 3:06:19 PM12/2/10
to wolfcms...@googlegroups.com
Revision: 345
Author: martij...@gmail.com
Date: Thu Dec 2 12:03:29 2010
Log: Fixed title validation issue - issue 61 - thanks axjezzy
http://code.google.com/p/wolfcms/source/detail?r=345

Modified:
/trunk/docs/changelog.txt
/trunk/wolf/app/controllers/PageController.php

=======================================
--- /trunk/docs/changelog.txt Fri Nov 26 10:37:02 2010
+++ /trunk/docs/changelog.txt Thu Dec 2 12:03:29 2010
@@ -51,6 +51,7 @@
+ Added Lithuanian translation for core - Thanks Remigijus Jarmalavicius -
issue 236
+ Added Spanish translation for comment plugin - Thanks alterebro - issue
254
+ Added expanded footnote on renaming htaccess file on requirements check
screen. - issue 175
+- Fixed title validation issue - issue 61 - thanks axjezzy
- Fixed hardcoded plugins path - issue 257 - thanks reekenx
- Fixed empty slug issue with home page - Thanks razon - issue 242
- Fixed quote issue with page title fields - issue 35
=======================================
--- /trunk/wolf/app/controllers/PageController.php Mon Nov 22 08:01:59 2010
+++ /trunk/wolf/app/controllers/PageController.php Thu Dec 2 12:03:29 2010
@@ -361,18 +361,20 @@
$errors[] = __('No CSRF token found!');
}

+ $data['title'] = trim($data['title']);
if (empty($data['title'])) {
$errors[] = __('You have to specify a title!');
}

+ $data['slug'] = trim($data['slug']);
if (empty($data['slug']) && $id != '1') {
$errors[] = __('You have to specify a slug!');
}
else {
- if (trim($data['slug']) == ADMIN_DIR) {
+ if ($data['slug'] == ADMIN_DIR) {
$errors[] = __('You cannot have a slug named :slug!',
array(':slug' => ADMIN_DIR));
}
- if ($id != '1' && !Validate::slug($data['slug'])) {
+ if (!Validate::slug($data['slug'])) {
$errors[] = __('Illegal value for :fieldname field!',
array(':fieldname' => 'slug'));
}
}

Reply all
Reply to author
Forward
0 new messages