Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Validate DS and Event names. When components are handlised, non-latin…

…-based alphabets are truncated. Validation avoids the edge case where a file contains only non-ascii characters, which would create empty filenames.
  • Loading branch information...
commit 1ea7d2ca225955a6cccffb0e350b31f60108052b 1 parent 8ed9e89
@allen allen authored
View
5 symphony/content/content.blueprintsdatasources.php
@@ -934,8 +934,11 @@ public function __formAction(){
$classname = Lang::createHandle($fields['name'], NULL, '_', false, true, array('@^[^a-z]+@i' => '', '/[^\w-\.]/i' => ''));
$rootelement = str_replace('_', '-', $classname);
- $file = DATASOURCES . '/data.' . $classname . '.php';
+ ##Check to make sure the classname is not empty after handlisation.
+ if(empty($classname)) $this->_errors['name'] = __('Please ensure name contains at least one Latin-based alphabet.', array($classname));
+ $file = DATASOURCES . '/data.' . $classname . '.php';
+
$isDuplicate = false;
$queueForDeletion = NULL;
View
3  symphony/content/content.blueprintsevents.php
@@ -263,6 +263,9 @@ public function __formAction(){
$classname = Lang::createHandle($fields['name'], NULL, '_', false, true, array('@^[^a-z]+@i' => '', '/[^\w-\.]/i' => ''));
$rootelement = str_replace('_', '-', $classname);
+ ##Check to make sure the classname is not empty after handlisation.
+ if(empty($classname)) $this->_errors['name'] = __('Please ensure name contains at least one Latin-based alphabet.', array($classname));
+
$file = EVENTS . '/event.' . $classname . '.php';
$isDuplicate = false;
Please sign in to comment.
Something went wrong with that request. Please try again.