Merge pull request #4003 from alfonso-salces/MOBILE-4470
MOBILE-4470 external-content: Fix url replacement in inline stylesmain
commit
7142177e47
|
@ -39,6 +39,7 @@ import { AsyncDirective } from '@classes/async-directive';
|
|||
import { CoreDirectivesRegistry } from '@singletons/directives-registry';
|
||||
import { CorePromisedValue } from '@classes/promised-value';
|
||||
import { CorePlatform } from '@services/platform';
|
||||
import { CoreTextUtils } from '@services/utils/text';
|
||||
|
||||
/**
|
||||
* Directive to handle external content.
|
||||
|
@ -287,7 +288,7 @@ export class CoreExternalContentDirective implements AfterViewInit, OnChanges, O
|
|||
const finalUrl = await CoreFilepool.getSrcByUrl(siteId, url, this.component, this.componentId, 0, true, true);
|
||||
|
||||
this.logger.debug('Using URL ' + finalUrl + ' for ' + url + ' in inline styles');
|
||||
inlineStyles = inlineStyles.replace(new RegExp(url, 'gi'), finalUrl);
|
||||
inlineStyles = inlineStyles.replace(new RegExp(CoreTextUtils.escapeForRegex(url), 'gi'), finalUrl);
|
||||
});
|
||||
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue