Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ichaykin/1c38712d025eacf940dd6446bebf5c93 to your computer and use it in GitHub Desktop.
Save ichaykin/1c38712d025eacf940dd6446bebf5c93 to your computer and use it in GitHub Desktop.
diff --git a/app/controllers/frontend/theme_editor.php b/app/controllers/frontend/theme_editor.php
index a5b583c..27d5b2e 100644
--- a/app/controllers/frontend/theme_editor.php
+++ b/app/controllers/frontend/theme_editor.php
@@ -212,6 +212,10 @@ if ($mode == 'view') {
$_REQUEST['style_id'] = $_REQUEST['preset_id'];
}
+ if (!empty($_REQUEST['name'])) {
+ $_REQUEST['name'] = trim($_REQUEST['name']);
+ }
+
if (!empty($_REQUEST['name']) && Styles::factory($theme->getThemeName())->copy($_REQUEST['style_id'], $_REQUEST['name'])) {
fn_theme_editor_set_style($_REQUEST['name']);
} else {
diff --git a/js/tygh/theme_editor.js b/js/tygh/theme_editor.js
index 902307e..99a18d6 100644
--- a/js/tygh/theme_editor.js
+++ b/js/tygh/theme_editor.js
@@ -244,7 +244,7 @@
return false;
}
- return style_name;
+ return style_name.trim();
}
function getEditorUrl(css_filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment