Skip to content
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

Merged
merged 6 commits into from
Jan 17, 2018
Merged

Debugger: Validate breakpoint file and line #834

merged 6 commits into from
Jan 17, 2018

Conversation

chingor13
Copy link
Contributor

Adds additional validation to a breakpoint by validating the source location.

  • Ensure the file exists and is readable
  • Ensure the file is a .php file
  • Ensure the line is not empty or a comment line

The Daemon does the validation and immediately reports validation errors back to the stackdriver server.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 5, 2018
@jdpedrie jdpedrie added the api: clouddebugger Issues related to the Cloud Debugger API. label Jan 8, 2018
@chingor13 chingor13 requested a review from tmatsuo January 16, 2018 23:45
}
} 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.


// 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.

Copy link
Contributor

@dwsupplee dwsupplee left a 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.

return true;
}

private function validateSourceLocation()

This comment was marked as spam.

@dwsupplee dwsupplee merged commit 81b20d0 into googleapis:master Jan 17, 2018
@chingor13 chingor13 deleted the validate-file-line branch January 17, 2018 23:10
@dwsupplee dwsupplee mentioned this pull request Jan 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: clouddebugger Issues related to the Cloud Debugger API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants