MOBILE-4688 file: Fix files with unencoded % in iOS too
This commit is contained in:
		
							parent
							
								
									c08fff39c0
								
							
						
					
					
						commit
						6764ab74b5
					
				| @ -152,7 +152,7 @@ export class CoreFileProvider { | |||||||
|         try { |         try { | ||||||
|             return <FileEntry> await File.resolveLocalFilesystemUrl(this.addBasePathIfNeeded(path)); |             return <FileEntry> await File.resolveLocalFilesystemUrl(this.addBasePathIfNeeded(path)); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             if (error && error.code === FileError.NOT_FOUND_ERR) { |             if (error && (error.code === FileError.NOT_FOUND_ERR || error.code === FileError.ENCODING_ERR)) { | ||||||
|                 // Cannot read some files if the path contains the % character and it's not an encoded char. Try encoding it.
 |                 // Cannot read some files if the path contains the % character and it's not an encoded char. Try encoding it.
 | ||||||
|                 const encodedPath = encodeURI(path); |                 const encodedPath = encodeURI(path); | ||||||
|                 if (encodedPath !== path) { |                 if (encodedPath !== path) { | ||||||
| @ -178,7 +178,7 @@ export class CoreFileProvider { | |||||||
|         try { |         try { | ||||||
|             return await File.resolveDirectoryUrl(this.addBasePathIfNeeded(path)); |             return await File.resolveDirectoryUrl(this.addBasePathIfNeeded(path)); | ||||||
|         } catch (error) { |         } catch (error) { | ||||||
|             if (error && error.code === FileError.NOT_FOUND_ERR) { |             if (error && (error.code === FileError.NOT_FOUND_ERR || error.code === FileError.ENCODING_ERR)) { | ||||||
|                 // Cannot read some files if the path contains the % character and it's not an encoded char. Try encoding it.
 |                 // Cannot read some files if the path contains the % character and it's not an encoded char. Try encoding it.
 | ||||||
|                 const encodedPath = encodeURI(path); |                 const encodedPath = encodeURI(path); | ||||||
|                 if (encodedPath !== path) { |                 if (encodedPath !== path) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user