Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Forms: fixed JSON optimization in BaseControl::getControl()

  • Loading branch information...
commit 936095ccd6abc10e6b2181376015779f03f48f59 1 parent 0180d95
@dg dg authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 Nette/Forms/Controls/BaseControl.php
View
4 Nette/Forms/Controls/BaseControl.php
@@ -392,8 +392,8 @@ public function getControl()
$rules = self::exportRules($this->rules);
$rules = substr(json_encode($rules), 1, -1);
- $rules = preg_replace('#"([a-z0-9]+)":#i', '$1:', $rules);
- $rules = preg_replace('#(?<!\\\\)"([^\\\\\',]*)"#i', "'$1'", $rules);
+ $rules = preg_replace('#"([a-z0-9_]+)":#i', '$1:', $rules);
+ $rules = preg_replace('#(?<!\\\\)"(?!:[^a-z])([^\\\\\',]*)"#i', "'$1'", $rules);
$control->data('nette-rules', $rules ? $rules : NULL);
return $control;
Please sign in to comment.
Something went wrong with that request. Please try again.