Skip to content

Commit

Permalink
ensure that bug_file_loc always uses the correct protocol fixes bug 7…
Browse files Browse the repository at this point in the history
…15202
  • Loading branch information
Schalk Neethling committed Feb 23, 2012
1 parent ab817b6 commit 277ebbb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
15 changes: 14 additions & 1 deletion webapp-php/application/views/kohana_error_page.php
Expand Up @@ -77,7 +77,20 @@
<p>Something bad happened. It's not you, it's me.</p>
<p>Please
<?php } ?>
file an <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Socorro&component=General&bug_file_loc=<?php echo urlencode($_SERVER['SCRIPT_URI']); ?>">issue in Bugzilla</a> describing what happened, and please include the URL for this page.</p>
<?php
/**
* The only of the $_SERVER elements that keeps the correct protocol
* i.e. http(s) is the referer constant but, that does not work for our
* requirements here hence, we use the method below to ensure our bug_file_loc
* URL's protocol matches the protocol it was served on.
*/
$protocol = (!empty($_SERVER['HTTPS']) ? "https://" : "http://");
$server_name = $_SERVER['SERVER_NAME'];
$path = $_SERVER['REQUEST_URI'];

$current_url = $protocol . $server_name . $path;
?>
file an <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Socorro&component=General&bug_file_loc=<?php echo urlencode($current_url); ?>">issue in Bugzilla</a> describing what happened, and please include the URL for this page.</p>
</div>
</div>
</div>
Expand Down
15 changes: 14 additions & 1 deletion webapp-php/application/views/report/notfound.php
@@ -1,4 +1,17 @@
<div id="mainbody">
<?php
/**
* The only of the $_SERVER elements that keeps the correct protocol
* i.e. http(s) is the referer constant but, that does not work for our
* requirements here hence, we use the method below to ensure our bug_file_loc
* URL's protocol matches the protocol it was served on.
*/
$protocol = (!empty($_SERVER['HTTPS']) ? "https://" : "http://");
$server_name = $_SERVER['SERVER_NAME'];
$path = $_SERVER['REQUEST_URI'];

$current_url = $protocol . $server_name . $path;
?>
<div class="page-heading">
<h2>Crash Not Found</h2>
</div>
Expand All @@ -7,7 +20,7 @@
<p>We couldn't find the OOID you're after. If you recently submitted this crash, it may still be in the queue.</p>

<p>If you believe this message is an error, please
submit a <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Webtools&component=Socorro&bug_file_loc=<?php echo urlencode($_SERVER['SCRIPT_URI']); ?>">Bugzilla ticket</a> describing what happened, and please include the URL for this page.</p>
submit a <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Webtools&component=Socorro&bug_file_loc=<?php echo urlencode($current_url); ?>">Bugzilla ticket</a> describing what happened, and please include the URL for this page.</p>
</div>
</div>
</div>

0 comments on commit 277ebbb

Please sign in to comment.