File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -421,7 +421,7 @@ cls.CookieManager.CookieManagerViewBase = function()
421421
422422 var name = edit_tr . querySelector ( "[name='name']" ) . value . trim ( ) ;
423423 var value = edit_tr . querySelector ( "[name='value']" ) . value ;
424- var expires = new Date ( edit_tr . querySelector ( "[name='expires']" ) . value || 0 ) . getTime ( ) ;
424+ var expires = edit_tr . querySelector ( "[name='expires']" ) . value ;
425425 var path = edit_tr . querySelector ( "[name='path']" ) . value . trim ( ) ;
426426 var is_secure = + ( is_secure_input && is_secure_input . checked ) ;
427427 var is_http_only = + ( is_http_only_input && is_http_only_input . checked ) ;
@@ -430,6 +430,15 @@ cls.CookieManager.CookieManagerViewBase = function()
430430 // "domain" is val of [input] (with add_cookie service present), or runtimes .hostname
431431 var domain = domain_input && domain_input . value . trim ( ) || runtime && this . data . _rts [ runtime ] . hostname ;
432432
433+ // Fix expires value, work around CORE-47780: .value property of <input type=datetime-local>
434+ // element has two digits representing milliseconds, instead of three.
435+ if ( expires . split ( "." ) . length > 1 )
436+ {
437+ if ( expires . split ( "." ) [ 1 ] . length < 3 )
438+ expires += "0" ;
439+ }
440+ expires = new Date ( expires || 0 ) . getTime ( ) ;
441+
433442 var object_id = edit_tr . getAttribute ( "data-object-id" ) ;
434443 var old_cookie ;
435444 if ( object_id )
You can’t perform that action at this time.
0 commit comments