bug #14217 [WebProfilerBundle] Fix regexp (romqin)
This PR was squashed before being merged into the 2.6 branch (closes #14217).
Discussion
----------
[WebProfilerBundle] Fix regexp
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #12122
| License | MIT
| Doc PR |
Old PR #12124
Commits
-------
091b37e
[WebProfilerBundle] Fix regexp
This commit is contained in:
commit
624dafbd4d
@ -45,7 +45,7 @@ class Configuration implements ConfigurationInterface
|
|||||||
->end()
|
->end()
|
||||||
->end()
|
->end()
|
||||||
->booleanNode('intercept_redirects')->defaultFalse()->end()
|
->booleanNode('intercept_redirects')->defaultFalse()->end()
|
||||||
->scalarNode('excluded_ajax_paths')->defaultValue('^/bundles|^/_wdt')->end()
|
->scalarNode('excluded_ajax_paths')->defaultValue('^/(app(_[\\w]+)?\\.php/)?_wdt')->end()
|
||||||
->end()
|
->end()
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -203,7 +203,17 @@
|
|||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
/* prevent logging AJAX calls to static and inline files, like templates */
|
/* prevent logging AJAX calls to static and inline files, like templates */
|
||||||
if (url.substr(0, 1) === '/' && !url.match(new RegExp("{{ excluded_ajax_paths }}"))) {
|
var path = url;
|
||||||
|
if (url.substr(0, 1) === '/') {
|
||||||
|
if (0 === url.indexOf('{{ app.request.basePath|e('js') }}')) {
|
||||||
|
path = url.substr({{ app.request.basePath|length }});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (0 === url.indexOf('{{ (app.request.schemeAndHttpHost ~ app.request.basePath)|e('js') }}')) {
|
||||||
|
path = url.substr({{ (app.request.schemeAndHttpHost ~ app.request.basePath)|length }});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (path.substr(0, 1) === '/' && !path.match(new RegExp({{ excluded_ajax_paths|json_encode|raw }}))) {
|
||||||
var stackElement = {
|
var stackElement = {
|
||||||
loading: true,
|
loading: true,
|
||||||
error: false,
|
error: false,
|
||||||
|
@ -31,11 +31,11 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function getDebugModes()
|
public function getDebugModes()
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
array(array(), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/bundles|^/_wdt')),
|
array(array(), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt')),
|
||||||
array(array('intercept_redirects' => true), array('intercept_redirects' => true, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/bundles|^/_wdt')),
|
array(array('intercept_redirects' => true), array('intercept_redirects' => true, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt')),
|
||||||
array(array('intercept_redirects' => false), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/bundles|^/_wdt')),
|
array(array('intercept_redirects' => false), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt')),
|
||||||
array(array('toolbar' => true), array('intercept_redirects' => false, 'toolbar' => true, 'position' => 'bottom', 'excluded_ajax_paths' => '^/bundles|^/_wdt')),
|
array(array('toolbar' => true), array('intercept_redirects' => false, 'toolbar' => true, 'position' => 'bottom', 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt')),
|
||||||
array(array('position' => 'top'), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'top', 'excluded_ajax_paths' => '^/bundles|^/_wdt')),
|
array(array('position' => 'top'), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'top', 'excluded_ajax_paths' => '^/(app(_[\\w]+)?\\.php/)?_wdt')),
|
||||||
array(array('excluded_ajax_paths' => 'test'), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => 'test')),
|
array(array('excluded_ajax_paths' => 'test'), array('intercept_redirects' => false, 'toolbar' => false, 'position' => 'bottom', 'excluded_ajax_paths' => 'test')),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user