Skip to content

Commit

Permalink
Merge pull request getsentry#397 from getsentry/fix/path-normalization
Browse files Browse the repository at this point in the history
Various fixes for windows path normalization (Fixes getsentryGH-393)
  • Loading branch information
dcramer committed Jan 2, 2017
2 parents 9234c2c + b40ebd0 commit b6f94b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/Raven/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function setEnvironment($value)
private function getDefaultPrefixes()
{
$value = get_include_path();
return explode(':', $value);
return explode(PATH_SEPARATOR, $value);
}

private function _convertPath($value)
Expand Down
5 changes: 3 additions & 2 deletions lib/Raven/Stacktrace.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ public static function get_stack_info($frames,

// detect in_app based on app path
if ($app_path) {
$in_app = (bool)(substr($abs_path, 0, strlen($app_path)) === $app_path);
$norm_abs_path = @realpath($abs_path) ?: $abs_path;
$in_app = (bool)(substr($norm_abs_path, 0, strlen($app_path)) === $app_path);
if ($in_app && $excluded_app_paths) {
foreach ($excluded_app_paths as $path) {
if (substr($abs_path, 0, strlen($path)) === $path) {
if (substr($norm_abs_path, 0, strlen($path)) === $path) {
$in_app = false;
break;
}
Expand Down

0 comments on commit b6f94b4

Please sign in to comment.