File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,11 +50,11 @@ Configuration
5050 // Before loading DebugKit
5151 Configure::write('DebugKit.forceEnable', true);
5252
53- * ``DebugKit.ignorePaths `` - Regex pattern (including delimiter) to ignore paths.
53+ * ``DebugKit.ignorePathsPattern `` - Regex pattern (including delimiter) to ignore paths.
5454 DebugKit won't save data for request URLs that match this regex. Defaults to ``null ``::
5555
5656 // Ignore image paths
57- Configure::write('DebugKit.ignorePaths ', '/\.(jpg|png|gif)$/');
57+ Configure::write('DebugKit.ignorePathsPattern ', '/\.(jpg|png|gif)$/');
5858
5959* ``DebugKit.ignoreAuthorization `` - Set to true to ignore Cake Authorization plugin for DebugKit requests. Disabled by default.
6060
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ class ToolbarService
6767 ],
6868 'forceEnable ' => false ,
6969 'safeTld ' => [],
70- 'ignorePaths ' => null ,
70+ 'ignorePathsPattern ' => null ,
7171 ];
7272
7373 /**
@@ -214,18 +214,18 @@ public function initializePanels()
214214 */
215215 public function saveData (ServerRequest $ request , ResponseInterface $ response )
216216 {
217- $ ignorePaths = $ this ->getConfig ('ignorePaths ' );
217+ $ ignorePathsPattern = $ this ->getConfig ('ignorePathsPattern ' );
218218 $ path = $ request ->getUri ()->getPath ();
219219 $ statusCode = $ response ->getStatusCode ();
220220
221221 if (
222222 strpos ($ path , 'debug_kit ' ) !== false ||
223223 strpos ($ path , 'debug-kit ' ) !== false ||
224224 (
225- $ ignorePaths &&
225+ $ ignorePathsPattern &&
226226 $ statusCode >= 200 &&
227227 $ statusCode <= 299 &&
228- preg_match ($ ignorePaths , $ path )
228+ preg_match ($ ignorePathsPattern , $ path )
229229 )
230230 ) {
231231 return false ;
Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ public function testSaveDataIgnorePaths()
181181 'body ' => '<html><title>test</title><body><p>some text</p></body> ' ,
182182 ]);
183183
184- $ bar = new ToolbarService ($ this ->events , ['ignorePaths ' => '/\.(jpg|png|gif)$/ ' ]);
184+ $ bar = new ToolbarService ($ this ->events , ['ignorePathsPattern ' => '/\.(jpg|png|gif)$/ ' ]);
185185 $ this ->assertFalse ($ bar ->saveData ($ request , $ response ));
186186
187187 $ request = new Request ([
@@ -194,7 +194,7 @@ public function testSaveDataIgnorePaths()
194194 'body ' => '<html><title>test</title><body><p>some text</p></body> ' ,
195195 ]);
196196
197- $ bar = new ToolbarService ($ this ->events , ['ignorePaths ' => '/\.(jpg|png|gif)$/ ' ]);
197+ $ bar = new ToolbarService ($ this ->events , ['ignorePathsPattern ' => '/\.(jpg|png|gif)$/ ' ]);
198198 $ this ->assertNotEmpty ($ bar ->saveData ($ request , $ response ));
199199 }
200200
You can’t perform that action at this time.
0 commit comments