MOBILE-4470 external-content: Fix url replacement in inline styles

main
Alfonso Salces 2024-04-09 13:12:21 +02:00
parent 5a8ec1404d
commit fd40907483
1 changed files with 2 additions and 1 deletions

View File

@ -39,6 +39,7 @@ import { AsyncDirective } from '@classes/async-directive';
import { CoreDirectivesRegistry } from '@singletons/directives-registry'; import { CoreDirectivesRegistry } from '@singletons/directives-registry';
import { CorePromisedValue } from '@classes/promised-value'; import { CorePromisedValue } from '@classes/promised-value';
import { CorePlatform } from '@services/platform'; import { CorePlatform } from '@services/platform';
import { CoreTextUtils } from '@services/utils/text';
/** /**
* Directive to handle external content. * 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); 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'); 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 { try {