-
-
Notifications
You must be signed in to change notification settings - Fork 599
XDEBUG_FILE in cookie #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -650,6 +650,28 @@ int xdebug_format_output_filename(char **filename, char *format, char *script_na | |
| } | ||
| } break; | ||
|
|
||
| case 'K': { /* XDEBUG_FILE in cookie */ | ||
| zval **data; | ||
| char *char_ptr, *strval; | ||
| char *sess_name; | ||
|
|
||
| sess_name = "XDEBUG_FILE"; | ||
|
|
||
| if (PG(http_globals)[TRACK_VARS_COOKIE] && | ||
| zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_COOKIE]), sess_name, strlen(sess_name) + 1, (void **) &data) == SUCCESS && | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer sizeof(sess_name) here, and probably I'd prefer that line 656 and 658 are the same. I would also argue that the name should not be XDEBUG_FILE, but instead XDEBUG_EXTRA_INFO. What would be even better if it was an #define somewhere as a "constant". |
||
| Z_STRLEN_PP(data) < 100 /* Prevent any unrealistically long data being set as filename */ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The value "100" should also be a constant. |
||
| ) { | ||
| strval = estrdup(Z_STRVAL_PP(data)); | ||
|
|
||
| /* replace slashes, dots, question marks, plus signs, | ||
| * ampersands and spaces with underscores */ | ||
| while ((char_ptr = strpbrk(strval, "/\\.?&+ ")) != NULL) { | ||
| char_ptr[0] = '_'; | ||
| } | ||
| xdebug_str_add(&fname, strval, 0); | ||
| efree(strval); | ||
| } | ||
| } break; | ||
| case '%': /* literal % */ | ||
| xdebug_str_addl(&fname, "%", 1, 0); | ||
| break; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you pick "K" ? Can we make it "X", according to the xdebug_eXtra_info ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm new to this