forked from RGClary/ACM-Website
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed the “Add to Slack“ button to a “Request Slack Invite” button. Also patched contact form to prevent HTML injection in the response after sending a message. Closes #50
- Loading branch information
1 parent
2b09e31
commit 8b3e41a
Showing
4 changed files
with
34 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?php | ||
$from = $_POST['email'] . $_POST['m-email']; | ||
$from = '[email protected]'; | ||
|
||
$text = $_POST['text']; | ||
$to = '[email protected]'; | ||
|
@@ -53,15 +53,15 @@ | |
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; | ||
$headers .= "From: " . $from . "\r\n"."X-Mailer: php"; | ||
|
||
$stat = ''; | ||
$message_stat = ''; | ||
if(mail($to, 'Message on acm-utsa.org', $body, $headers)){ | ||
$stat = 'Your message has successfully been sent'; | ||
$message_stat = '1'; | ||
} | ||
else{ | ||
$stat = 'Error: message failed to send'; | ||
$message_stat = '2'; | ||
} | ||
|
||
header('Location: contact?stat='.rawurlencode($stat)); | ||
header('Location: contact?message_stat='.rawurlencode($message_stat)); | ||
?> | ||
<!DOCTYPE html> | ||
<html> | ||
|
@@ -105,8 +105,8 @@ | |
</p> | ||
</div> | ||
<div class="col-sm-4" style="text-align:center;"> | ||
<a href="http://acm-utsa.slack.com"> | ||
<input type="image" src="images/icons/add-to-slack.png" class="slack-button"/> | ||
<a class="link" href="slack_invite" target="_blank"> | ||
<input type="image" src="images/icons/add-to-slack.png" class="slack-button" style="outline-style: none;" /> | ||
</a> | ||
</div> | ||
</div> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> <title>Slack Invite</title> <style type="text/css"> html{ margin: 0; height: 100%; overflow: hidden; } iframe{ position: absolute; left:0; right:0; bottom:0; top:0; border:0; } </style> </head> <body> <iframe id="typeform-full" width="100%" height="100%" frameborder="0" src="https://acm-utsa.typeform.com/to/w2QdZg"></iframe> <script type="text/javascript" src="https://embed.typeform.com/embed.js"></script> </body> </html> |