forked from EVOgeek/Vmeda.Online
		
	MOBILE-4303 iframe: Fix auto-login applied in H5P local URLs
This commit is contained in:
		
							parent
							
								
									8ce5414980
								
							
						
					
					
						commit
						f8d3c023cc
					
				| @ -156,8 +156,14 @@ export class CoreIframeComponent implements OnChanges, OnDestroy { | |||||||
|      * Detect changes on input properties. |      * Detect changes on input properties. | ||||||
|      */ |      */ | ||||||
|     async ngOnChanges(changes: {[name: string]: SimpleChange }): Promise<void> { |     async ngOnChanges(changes: {[name: string]: SimpleChange }): Promise<void> { | ||||||
|         if (changes.src) { |         if (!changes.src) { | ||||||
|             let url = CoreUrlUtils.getYoutubeEmbedUrl(changes.src.currentValue) || changes.src.currentValue; |             return; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         let url = changes.src.currentValue; | ||||||
|  | 
 | ||||||
|  |         if (!CoreUrlUtils.isLocalFileUrl(url)) { | ||||||
|  |             url = CoreUrlUtils.getYoutubeEmbedUrl(changes.src.currentValue) || changes.src.currentValue; | ||||||
|             this.displayHelp = CoreIframeUtils.shouldDisplayHelpForUrl(url); |             this.displayHelp = CoreIframeUtils.shouldDisplayHelpForUrl(url); | ||||||
| 
 | 
 | ||||||
|             const currentSite = CoreSites.getCurrentSite(); |             const currentSite = CoreSites.getCurrentSite(); | ||||||
| @ -173,6 +179,7 @@ export class CoreIframeComponent implements OnChanges, OnDestroy { | |||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             await CoreIframeUtils.fixIframeCookies(url); |             await CoreIframeUtils.fixIframeCookies(url); | ||||||
|  |         } | ||||||
| 
 | 
 | ||||||
|         this.safeUrl = DomSanitizer.bypassSecurityTrustResourceUrl(CoreFile.convertFileSrc(url)); |         this.safeUrl = DomSanitizer.bypassSecurityTrustResourceUrl(CoreFile.convertFileSrc(url)); | ||||||
| 
 | 
 | ||||||
| @ -181,7 +188,6 @@ export class CoreIframeComponent implements OnChanges, OnDestroy { | |||||||
|             this.init(); |             this.init(); | ||||||
|         }); |         }); | ||||||
|     } |     } | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     /** |     /** | ||||||
|      * Open help modal for iframes. |      * Open help modal for iframes. | ||||||
|  | |||||||
| @ -504,7 +504,7 @@ export class CoreUrlUtilsProvider { | |||||||
|      */ |      */ | ||||||
|     removeProtocolAndWWW(url: string): string { |     removeProtocolAndWWW(url: string): string { | ||||||
|         // Remove protocol.
 |         // Remove protocol.
 | ||||||
|         url = url.replace(/.*?:\/\//g, ''); |         url = url.replace(/^.*?:\/\//, ''); | ||||||
|         // Remove www.
 |         // Remove www.
 | ||||||
|         url = url.replace(/^www./, ''); |         url = url.replace(/^www./, ''); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user