@@ -1201,6 +1201,8 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
12011201 var userName = findMeta ( aMeta , 'OpenUserJS.author.0.value' ) || aUser . name ;
12021202 var scriptName = null ;
12031203 var scriptDescription = null ;
1204+ var thisName = null ;
1205+ var thisDescription = null ;
12041206 var hasInvalidKey = null ;
12051207
12061208 async . series ( [
@@ -1251,7 +1253,8 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
12511253 // Check for non-localized presence
12521254 name . forEach ( function ( aElement , aIndex , aArray ) {
12531255 if ( ! name [ aIndex ] . key ) {
1254- scriptName = aElement . value ;
1256+ thisName = aElement . value ;
1257+ scriptName = cleanFilename ( thisName , '' ) ;
12551258 }
12561259 } ) ;
12571260
@@ -1311,7 +1314,8 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
13111314 if ( description ) {
13121315 description . forEach ( function ( aElement , aIndex , aArray ) {
13131316 if ( ! description [ aIndex ] . key ) {
1314- scriptDescription = aElement . value ;
1317+ thisDescription = aElement . value ;
1318+ scriptDescription = cleanFilename ( thisDescription , '' ) ;
13151319 }
13161320 } ) ;
13171321 }
@@ -2083,15 +2087,15 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
20832087
20842088
20852089 storeDescriptionLength = settings . scriptSearchQueryStoreMaxDescription ;
2086- storeDescriptionLength = rLogographic . test ( scriptDescription )
2090+ storeDescriptionLength = rLogographic . test ( thisDescription )
20872091 ? parseInt ( storeDescriptionLength / logographicDivisor )
20882092 : storeDescriptionLength ;
20892093
20902094 aScript = new Script ( {
2091- name : scriptName ,
2095+ name : thisName ,
20922096 _description : (
2093- scriptDescription
2094- ? scriptDescription . substr ( 0 , storeDescriptionLength ) . trim ( )
2097+ thisDescription
2098+ ? thisDescription . substr ( 0 , storeDescriptionLength ) . trim ( )
20952099 : ''
20962100 ) ,
20972101 author : aUser . name ,
@@ -2133,13 +2137,13 @@ exports.storeScript = function (aUser, aMeta, aBuf, aUpdate, aCallback) {
21332137 }
21342138
21352139 storeDescriptionLength = settings . scriptSearchQueryStoreMaxDescription ;
2136- storeDescriptionLength = rLogographic . test ( scriptDescription )
2140+ storeDescriptionLength = rLogographic . test ( thisDescription )
21372141 ? parseInt ( storeDescriptionLength / logographicDivisor )
21382142 : storeDescriptionLength ;
21392143
21402144 aScript . _description = (
2141- scriptDescription
2142- ? scriptDescription . substr ( 0 , storeDescriptionLength ) . trim ( )
2145+ thisDescription
2146+ ? thisDescription . substr ( 0 , storeDescriptionLength ) . trim ( )
21432147 : ''
21442148 ) ;
21452149 aScript . meta = aMeta ;
0 commit comments