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 {}
89
89
@Injectable ( { providedIn : 'root' , useExisting : forwardRef ( ( ) => DomSanitizerImpl ) } )
90
90
export abstract class DomSanitizer implements Sanitizer {
91
91
/**
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 .
93
93
*
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.
98
99
*/
99
100
abstract sanitize ( context : SecurityContext , value : SafeValue | string | null ) : string | null ;
100
101
You can’t perform that action at this time.
0 commit comments