-
Notifications
You must be signed in to change notification settings - Fork 438
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
Debugger: Validate breakpoint file and line #834
Conversation
src/Debugger/Breakpoint.php
Outdated
} | ||
} catch (\ParseError $e) { | ||
// Ensure the file is a php file | ||
if ($info->getExtension() !== "php") { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/Debugger/Breakpoint.php
Outdated
|
||
// Ensure the line exists and is not a comment in the file | ||
if ($line === false || | ||
preg_match('/^\s*[\/\*]+/', $line) || |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
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.
Looks good to me, outside the comments @tmatsuo addressed.
@@ -0,0 +1,156 @@ | |||
<?php | |||
/** | |||
* Copyright 2017 Google Inc. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This won't catch comments that are multiline that don't begin with *.
src/Debugger/Breakpoint.php
Outdated
return true; | ||
} | ||
|
||
private function validateSourceLocation() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Adds additional validation to a breakpoint by validating the source location.
The
Daemon
does the validation and immediately reports validation errors back to the stackdriver server.