Skip to content

Commit

Permalink
Fix crash when creating a data source with a dash
Browse files Browse the repository at this point in the history
... in its name.
  • Loading branch information
nitriques committed Aug 17, 2018
1 parent 514f256 commit cc375c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions symphony/content/content.blueprintsdatasources.php
Expand Up @@ -1218,7 +1218,10 @@ public function __formAction()
}

$classname = Lang::createHandle($fields['name'], 255, '_', false, true, array('@^[^a-z\d]+@i' => '', '/[^\w-\.]/i' => ''));
// XML wants dashes
$rootelement = str_replace('_', '-', $classname);
// PHP wants underscores
$classname = str_replace('-', '_', $classname);

// Check to make sure the classname is not empty after handlisation.
if (empty($classname) && !isset($this->_errors['name'])) {
Expand Down

0 comments on commit cc375c5

Please sign in to comment.