xdebug名称参数%R的替换规则
Replacement rules of xdebug name parameter %R
在输出名称配置中用于 %R
参数的 URI 应用的替换规则是什么? documentation(参数:xdebug.trace_output_name
)只给出了一个例子,可以用不同的方式解释:
trace._test_xdebug_test_php_var=1_var2=2.xt
可以是
/test/xdebug_test.php?var=1&var2=2
或
/test_xdebug/test.php?var=1&var2=2
或
/test/xdebug/test.php?var=1&var2=2
(如何)我可以从 xdebug 转储名称重新创建 uri?
我检查了 xdebug source code 并找到了替换字符的函数:
if (data) {
strval = estrdup(Z_STRVAL_P(data));
/* replace slashes, dots, question marks, plus
* signs, ampersands, spaces and other evil chars
* with underscores */
while ((char_ptr = strpbrk(strval, "/\.?&+:*\"<>| ")) != NULL) {
char_ptr[0] = '_';
}
xdebug_str_add(&fname, strval, 0);
efree(strval);
}
tl;dr:/\.?&+:*"<>|
在使用 apache 试验字符列表时作为辅助节点:
- space 被编码为
%20
,因此不会被 _
取代
- <,> 被编码为
%3C
和 %3E
,因此不会被 _
替换
"
编码为 %22
,因此不会被 _
替换
您无法从生成的文件名返回到完整的 URL,因为信息丢失,因为一些字符基本上被替换为 _
,正如您已经在评论中添加的那样.
在输出名称配置中用于 %R
参数的 URI 应用的替换规则是什么? documentation(参数:xdebug.trace_output_name
)只给出了一个例子,可以用不同的方式解释:
trace._test_xdebug_test_php_var=1_var2=2.xt
可以是
/test/xdebug_test.php?var=1&var2=2
或
/test_xdebug/test.php?var=1&var2=2
或
/test/xdebug/test.php?var=1&var2=2
(如何)我可以从 xdebug 转储名称重新创建 uri?
我检查了 xdebug source code 并找到了替换字符的函数:
if (data) {
strval = estrdup(Z_STRVAL_P(data));
/* replace slashes, dots, question marks, plus
* signs, ampersands, spaces and other evil chars
* with underscores */
while ((char_ptr = strpbrk(strval, "/\.?&+:*\"<>| ")) != NULL) {
char_ptr[0] = '_';
}
xdebug_str_add(&fname, strval, 0);
efree(strval);
}
tl;dr:/\.?&+:*"<>|
在使用 apache 试验字符列表时作为辅助节点:
- space 被编码为
%20
,因此不会被_
取代
- <,> 被编码为
%3C
和%3E
,因此不会被_
替换
"
编码为%22
,因此不会被_
替换
您无法从生成的文件名返回到完整的 URL,因为信息丢失,因为一些字符基本上被替换为 _
,正如您已经在评论中添加的那样.