Skip to content

Commit

Permalink
fix security warnings (#264)
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek authored Mar 5, 2024
1 parent 34283cb commit 96ff254
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 22 deletions.
8 changes: 4 additions & 4 deletions teammapper-frontend/src/app/core/services/mmp/mmp.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { jsPDF } from 'jspdf';
import { first } from 'rxjs/operators';
import * as mmp from '@mmp/index';
import MmpMap from '@mmp/map/map';
import DOMPurify from 'dompurify';
import {
ExportHistory,
ExportNodeProperties,
Expand Down Expand Up @@ -369,10 +370,9 @@ export class MmpService implements OnDestroy {
* Export the current mind map with the format passed as parameter.
*/
public async exportMap(format = 'json') {
const name = this.getRootNode()
.name.replace(/\n/g, ' ')
.replace(/\s+/g, ' ')
.replace(/<[^>]*>?/gm, '');
const name = DOMPurify.sanitize(
this.getRootNode().name.replace(/\n/g, ' ').replace(/\s+/g, ' ')
);

switch (format) {
case 'json': {
Expand Down
16 changes: 0 additions & 16 deletions teammapper-frontend/src/app/shared/pipes/striptags.pipe.ts

This file was deleted.

3 changes: 1 addition & 2 deletions teammapper-frontend/src/app/shared/shared.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { RouterModule } from '@angular/router';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
import { MatIconModule } from '@angular/material/icon';
import { MatToolbarModule } from '@angular/material/toolbar';
import { StripTags } from './pipes/striptags.pipe';
import { InverseBoolPipe } from './pipes/inverse-bool.pipe';
import { MatDialogModule } from '@angular/material/dialog';
import { MatGridListModule } from '@angular/material/grid-list';
Expand All @@ -21,7 +20,7 @@ import { MatInputModule } from '@angular/material/input';
import { MatSelectModule } from '@angular/material/select';
import { MatSlideToggleModule } from '@angular/material/slide-toggle';

const PIPES = [StripTags, InverseBoolPipe];
const PIPES = [InverseBoolPipe];

@NgModule({
imports: [
Expand Down

0 comments on commit 96ff254

Please sign in to comment.