Skip to content

Commit

Permalink
Use HTTPS Twitter URLs by default
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasbynens committed Aug 31, 2014
1 parent b4d5538 commit 9ba54bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
$slug = $_GET['slug'];

if ('@' == $slug) {
$url = 'http://twitter.com/' . TWITTER_USERNAME;
$url = 'https://twitter.com/' . TWITTER_USERNAME;
} else if (' ' == $slug) { // +
$url = 'https://plus.google.com/u/0/' . GOOGLE_PLUS_ID . '/posts';
} else {

$slug = preg_replace('/[^a-z0-9]/si', '', $slug);

if (is_numeric($slug) && strlen($slug) > 8) {
$url = 'http://twitter.com/' . TWITTER_USERNAME . '/status/' . $slug;
$url = 'https://twitter.com/' . TWITTER_USERNAME . '/status/' . $slug;
} else {

$db = new MySQLi(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE);
Expand All @@ -43,4 +43,4 @@

$attributeValue = htmlspecialchars($url);
?>
<meta http-equiv=refresh content="0;URL=<?php echo $attributeValue; ?>"><a href="<?php echo $attributeValue; ?>">Continue</a><script>location.href=<?php echo json_encode($url, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES); ?></script>
<meta http-equiv=refresh content="0;URL=<?php echo $attributeValue; ?>"><a href="<?php echo $attributeValue; ?>">Continue</a><script>location.href=<?php echo json_encode($url, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES); ?></script>

0 comments on commit 9ba54bb

Please sign in to comment.