mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-30 23:23:02 +00:00 
			
		
		
		
	Fix $tw.utils.decodeURISafe and $tw.utils.decodeURIComponentSafe not available during boot process (#6107)
* call self.displayError
* Revert "call self.displayError"
This reverts commit 5d599aa979.
* fix 5999 URI utils bug
			
			
This commit is contained in:
		
							
								
								
									
										22
									
								
								boot/boot.js
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								boot/boot.js
									
									
									
									
									
								
							| @@ -256,6 +256,28 @@ $tw.utils.deepDefaults = function(object /*, sourceObjectList */) { | ||||
| 	return object; | ||||
| }; | ||||
|  | ||||
| /* | ||||
| Convert a URIComponent encoded string to a string safely | ||||
| */ | ||||
| $tw.utils.decodeURIComponentSafe = function(s) { | ||||
| 	var v = s; | ||||
| 	try { | ||||
| 		v = decodeURIComponent(s); | ||||
| 	} catch(e) {} | ||||
| 	return v; | ||||
| }; | ||||
|  | ||||
| /* | ||||
| Convert a URI encoded string to a string safely | ||||
| */ | ||||
| $tw.utils.decodeURISafe = function(s) { | ||||
| 	var v = s; | ||||
| 	try { | ||||
| 		v = decodeURI(s); | ||||
| 	} catch(e) {} | ||||
| 	return v; | ||||
| }; | ||||
|  | ||||
| /* | ||||
| Convert "&" to &, " " to nbsp, "<" to <, ">" to > and """ to " | ||||
| */ | ||||
|   | ||||
| @@ -978,22 +978,4 @@ exports.makeCompareFunction = function(type,options) { | ||||
| 	return (types[type] || types[options.defaultType] || types.number); | ||||
| }; | ||||
|  | ||||
| exports.decodeURIComponentSafe = function(str) { | ||||
| 	var value = str; | ||||
| 	try { | ||||
| 		value = decodeURIComponent(str); | ||||
| 	} catch(e) { | ||||
| 	} | ||||
| 	return value; | ||||
| }; | ||||
|  | ||||
| exports.decodeURISafe = function(str) { | ||||
| 	var value = str; | ||||
| 	try { | ||||
| 		value = decodeURI(str); | ||||
| 	} catch(e) { | ||||
| 	} | ||||
| 	return value; | ||||
| }; | ||||
|  | ||||
| })(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Joshua Fontany
					Joshua Fontany