@@ -100,7 +100,7 @@ window.component('push', function(push) {
100
100
this . sent = m . prop ( data . sent ) ;
101
101
this . sound = vprop ( data . sound , function ( v ) { return ! ! v ; } , t ( 'pu.po.tab2.extras.sound.invalid' ) ) ;
102
102
this . badge = vprop ( data . badge , function ( v ) { return v === undefined || ( ( v + '' ) === ( parseInt ( v ) + '' ) && parseInt ( v ) >= 0 ) ; } , t ( 'pu.po.tab2.extras.badge.invalid' ) ) ;
103
- this . url = vprop ( data . url , function ( v ) { return v && URL_REGEXP . test ( v ) ; } , t ( 'pu.po.tab2.extras.url.invalid' ) ) ;
103
+ this . url = vprop ( data . url , function ( v ) { return v && URL_REGEXP . test ( v ) && v [ 0 ] !== ' ' && v [ v . length - 1 ] !== ' ' ; } , t ( 'pu.po.tab2.extras.url.invalid' ) ) ;
104
104
this . data = vprop ( typeof data . data === 'object' ? JSON . stringify ( data . data ) : data . data , function ( v ) {
105
105
try {
106
106
var o = window . jsonlite . parse ( v ) ;
@@ -224,6 +224,9 @@ window.component('push', function(push) {
224
224
var prop = m . prop ( ) ,
225
225
f = function ( ) {
226
226
if ( arguments . length ) {
227
+ if ( arguments [ 0 ] ) {
228
+ arguments [ 0 ] = arguments [ 0 ] . trim ( ) ;
229
+ }
227
230
f . valid = false ;
228
231
prop ( arguments [ 0 ] ) ;
229
232
@@ -403,9 +406,15 @@ window.component('push', function(push) {
403
406
obj . sound = this . sound ( ) ;
404
407
obj . badge = this . badge ( ) ;
405
408
obj . url = this . url ( ) ;
409
+ if ( obj . url ) {
410
+ obj . url = obj . url . trim ( ) ;
411
+ }
406
412
obj . source = 'dash' ;
407
413
obj . buttons = parseInt ( this . buttons ( ) ) ;
408
414
obj . media = this . media ( ) ;
415
+ if ( obj . media ) {
416
+ obj . media = obj . media . trim ( ) ;
417
+ }
409
418
obj . autoOnEntry = this . autoOnEntry ( ) ;
410
419
obj . autoCancelTrigger = this . autoCancelTrigger ( ) ;
411
420
obj . autoCohorts = this . autoCohorts ( ) ;
0 commit comments