File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Changelog
22
3- ## Changes 01/24/2026 (v3.1.5)
3+ ## Changes 01/24/2026 (v3.1.5 & v3.1.6 )
44
5+ ` release(v3.1.6): CodeQL fix for error handling (strip HTML safely in fileActions) `
56` release(v3.1.5): Pro Sources adds OneDrive + Dropbox + source-aware UX fixes `
67
78** Commit message**
Original file line number Diff line number Diff line change @@ -54,6 +54,21 @@ function getTransferTotalsForNames(names) {
5454 } ;
5555}
5656
57+ function stripHtmlToText ( raw ) {
58+ const input = raw == null ? '' : String ( raw ) ;
59+ if ( input === '' ) return '' ;
60+ if ( typeof DOMParser !== 'undefined' ) {
61+ try {
62+ const doc = new DOMParser ( ) . parseFromString ( input , 'text/html' ) ;
63+ const out = doc && doc . body ? doc . body . textContent : '' ;
64+ return ( out || '' ) . trim ( ) ;
65+ } catch ( e ) {
66+ // Fall through to basic stripping.
67+ }
68+ }
69+ return input . replace ( / [ < > ] / g, '' ) . trim ( ) ;
70+ }
71+
5772const ARCHIVE_FORMATS = [ "zip" , "7z" ] ;
5873const ARCHIVE_NAME_SUFFIXES = [ "zip" , "7z" , "rar" ] ;
5974const ARCHIVE_EXT_RE = / \. ( z i p | 7 z | r a r ) $ / i;
@@ -600,7 +615,7 @@ export async function handleCreateFile(e) {
600615 try { js = JSON . parse ( raw ) ; } catch ( e ) { js = null ; }
601616 }
602617 if ( ! res . ok || ! js || ! js . success ) {
603- const text = raw ? raw . replace ( / < [ ^ > ] * > / g , '' ) . trim ( ) : '' ;
618+ const text = stripHtmlToText ( raw ) ;
604619 const msg = ( js && ( js . error || js . message ) ) || text || `HTTP ${ res . status } ` ;
605620 throw new Error ( msg ) ;
606621 }
You can’t perform that action at this time.
0 commit comments