diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 233c78d072e9d66d0118681f87940492f226f3f7..0fb7fee8cbd62a41887b23772e8c58bbc3ef556b 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -699,7 +699,15 @@ void LLFloaterEditExtDayCycle::onSaveAsCommit(const LLSD& notification, const LL
     if (0 == option)
     {
         std::string settings_name = response["message"].asString();
-        LLStringUtil::trim(settings_name);
+
+        LLInventoryObject::correctInventoryName(settings_name);
+        if (settings_name.empty())
+        {
+            // Ideally notification should disable 'OK' button if name won't fit our requirements,
+            // for now either display notification, or use some default name
+            settings_name = "Unnamed";
+        }
+
         if (mCanMod)
         {
             doApplyCreateNewInventory(day, settings_name);
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index b1fdc2d2a5c11e7b9b9cb1b3ce624e82bdd10ba6..05da6402589410573f77c5d38c93b202f4d0bbc2 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -474,7 +474,15 @@ void LLFloaterFixedEnvironment::onSaveAsCommit(const LLSD& notification, const L
     if (0 == option)
     {
         std::string settings_name = response["message"].asString();
-        LLStringUtil::trim(settings_name);
+
+        LLInventoryObject::correctInventoryName(settings_name);
+        if (settings_name.empty())
+        {
+            // Ideally notification should disable 'OK' button if name won't fit our requirements,
+            // for now either display notification, or use some default name
+            settings_name = "Unnamed";
+        }
+
         if (mCanMod)
         {
             doApplyCreateNewInventory(settings_name, settings);