@@ -69,7 +69,7 @@ public function __construct() {
69
69
$ this ->appTest = true ;
70
70
}
71
71
if (isset ($ _GET ['plugin ' ])) {
72
- $ this ->pluginTest = $ _GET ['plugin ' ];
72
+ $ this ->pluginTest = htmlentities ( $ _GET ['plugin ' ]) ;
73
73
}
74
74
}
75
75
@@ -127,8 +127,11 @@ public function runAllTests(&$reporter, $testing = false) {
127
127
public function runTestCase ($ testCaseFile , &$ reporter , $ testing = false ) {
128
128
$ testCaseFileWithPath = $ this ->_getTestsPath () . DS . $ testCaseFile ;
129
129
130
- if (!file_exists ($ testCaseFileWithPath )) {
131
- trigger_error (sprintf (__ ('Test case %s cannot be found ' , true ), $ testCaseFile ), E_USER_ERROR );
130
+ if (!file_exists ($ testCaseFileWithPath ) || strpos ($ testCaseFileWithPath , '.. ' )) {
131
+ trigger_error (
132
+ sprintf (__ ("Test case %s cannot be found " , true ), htmlentities ($ testCaseFile )),
133
+ E_USER_ERROR
134
+ );
132
135
return false ;
133
136
}
134
137
@@ -151,8 +154,14 @@ public function runTestCase($testCaseFile, &$reporter, $testing = false) {
151
154
public function runGroupTest ($ groupTestName , &$ reporter ) {
152
155
$ filePath = $ this ->_getTestsPath ('groups ' ) . DS . strtolower ($ groupTestName ) . $ this ->_groupExtension ;
153
156
154
- if (!file_exists ($ filePath )) {
155
- trigger_error (sprintf (__ ('Group test %s cannot be found at %s ' , true ), $ groupTestName , $ filePath ), E_USER_ERROR );
157
+ if (!file_exists ($ filePath ) || strpos ($ testCaseFileWithPath , '.. ' )) {
158
+ trigger_error (sprintf (
159
+ __ ("Group test %s cannot be found at %s " , true ),
160
+ htmlentities ($ groupTestName ),
161
+ htmlentities ($ filePath )
162
+ ),
163
+ E_USER_ERROR
164
+ );
156
165
}
157
166
158
167
require_once $ filePath ;
0 commit comments