File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
packages/platform-browser/src/security Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -89,12 +89,13 @@ export interface SafeResourceUrl extends SafeValue {}
8989@Injectable ( { providedIn : 'root' , useExisting : forwardRef ( ( ) => DomSanitizerImpl ) } )
9090export abstract class DomSanitizer implements Sanitizer {
9191 /**
92- * Sanitizes a value for use in the given SecurityContext .
92+ * Gets a safe value from either a known safe value or a value with unknown safety .
9393 *
94- * If value is trusted for the context, this method will unwrap the contained safe value and use
95- * it directly. Otherwise, value will be sanitized to be safe in the given context, for example
96- * by replacing URLs that have an unsafe protocol part (such as `javascript:`). The implementation
97- * is responsible to make sure that the value can definitely be safely used in the given context.
94+ * If the given value is already a `SafeValue`, this method returns the unwrapped value.
95+ * If the security context is HTML and the given value is a plain string, this method
96+ * sanitizes the string, removing any potentially unsafe content.
97+ * For any other security context, this method throws an error if provided
98+ * with a plain string.
9899 */
99100 abstract sanitize ( context : SecurityContext , value : SafeValue | string | null ) : string | null ;
100101
You can’t perform that action at this time.
0 commit comments