@@ -472,9 +472,10 @@ if (typeof Extras == "undefined" || !Extras)
472
472
473
473
obj . method = obj . method || Alfresco . util . Ajax . GET ;
474
474
475
- var objToParamString = function ( o )
475
+ var objToParamString = function ( o , spaceChar )
476
476
{
477
477
var params = "" , first = true , attr ;
478
+ spaceChar = spaceChar ;
478
479
for ( attr in o )
479
480
{
480
481
if ( o . hasOwnProperty ( attr ) )
@@ -487,7 +488,10 @@ if (typeof Extras == "undefined" || !Extras)
487
488
{
488
489
params += "&" ;
489
490
}
490
- params += encodeURIComponent ( attr ) + "=" + encodeURIComponent ( o [ attr ] ) ;
491
+ params += encodeURIComponent ( attr ) + "=" +
492
+ ( YAHOO . lang . isUndefined ( spaceChar ) ? encodeURIComponent ( o [ attr ] ) : encodeURIComponent ( "" + o [ attr ] ) .
493
+ replace ( "%20" , spaceChar , "g" ) . replace ( / ! / g, '%21' ) . replace ( / ' / g, '%27' ) . replace ( / \( / g, '%28' ) .
494
+ replace ( / \) / g, '%29' ) . replace ( / \* / g, '%2A' ) ) ;
491
495
}
492
496
}
493
497
return params ;
@@ -504,11 +508,11 @@ if (typeof Extras == "undefined" || !Extras)
504
508
var reqType = obj . requestContentType || Alfresco . util . Ajax . FORM ;
505
509
if ( ! YAHOO . lang . isValue ( obj . dataStr ) )
506
510
{
507
- if ( ( new RegExp ( "^\s*" + Alfresco . util . Ajax . FORM ) ) . test ( contentType ) )
511
+ if ( ( new RegExp ( "^\s*" + Alfresco . util . Ajax . FORM ) ) . test ( reqType ) )
508
512
{
509
- obj . dataStr = objToParamString ( obj . dataObj ) ;
513
+ obj . dataStr = objToParamString ( obj . dataObj , "+" ) ;
510
514
}
511
- else if ( ( new RegExp ( "^\s*" + Alfresco . util . Ajax . JSON ) ) . test ( contentType ) )
515
+ else if ( ( new RegExp ( "^\s*" + Alfresco . util . Ajax . JSON ) ) . test ( reqType ) )
512
516
{
513
517
obj . dataStr = YAHOO . lang . JSON . stringify ( c . dataObj || { } ) ;
514
518
}
0 commit comments