@@ -4,6 +4,7 @@ import advanced_security.javascript.frameworks.ui5.JsonParser
44import semmle.javascript.security.dataflow.DomBasedXssCustomizations
55import advanced_security.javascript.frameworks.ui5.UI5View
66import advanced_security.javascript.frameworks.ui5.UI5HTML
7+ import codeql.util.FileSystem
78
89private module WebAppResourceRootJsonReader implements JsonParser:: MakeJsonReaderSig< WebApp > {
910 class JsonReader extends WebApp {
@@ -33,12 +34,11 @@ private predicate isAnUnResolvedResourceRoot(WebApp webApp, string name, string
3334 )
3435}
3536
36- class ResourceRootPathString extends PathString {
37- WebApp webApp ;
38-
39- ResourceRootPathString ( ) { isAnUnResolvedResourceRoot ( webApp , _, this ) }
40-
41- override Folder getARootFolder ( ) { result = webApp .getWebAppFolder ( ) }
37+ private predicate shouldAppend ( Folder f , string relativePath ) {
38+ exists ( WebApp webApp |
39+ f = webApp .getWebAppFolder ( ) and
40+ isAnUnResolvedResourceRoot ( webApp , _, relativePath )
41+ )
4242}
4343
4444class ResourceRoot extends Container {
@@ -48,7 +48,7 @@ class ResourceRoot extends Container {
4848
4949 ResourceRoot ( ) {
5050 isAnUnResolvedResourceRoot ( webApp , name , path ) and
51- path . ( PathString ) . resolve ( webApp .getWebAppFolder ( ) ) . getContainer ( ) = this
51+ Folder :: Append < shouldAppend / 2 > :: append ( webApp .getWebAppFolder ( ) , path ) = this
5252 }
5353
5454 string getName ( ) { result = name }
@@ -168,7 +168,9 @@ class SapDefineModule extends AmdModuleDefinition::Range, MethodCallExpr, UserMo
168168 )
169169 }
170170
171- string getDependency ( int i ) { result = this .( AmdModuleDefinition ) .getDependencyExpr ( i ) .getStringValue ( ) }
171+ string getDependency ( int i ) {
172+ result = this .( AmdModuleDefinition ) .getDependencyExpr ( i ) .getStringValue ( )
173+ }
172174
173175 override string getADependency ( ) { result = this .getDependency ( _) }
174176
0 commit comments