Skip to content

Commit

Permalink
https
Browse files Browse the repository at this point in the history
  • Loading branch information
moesalih committed Apr 4, 2019
1 parent d7c8347 commit 2be0366
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 @@ -18,7 +18,7 @@ function curl($url) {

$headers = substr($response, 0, $info["header_size"]);

if (preg_match('/Location: http:\/\/en\.wikipedia\.org\/wiki\/(.*)/', $headers, $matches)) {
if (preg_match('/Location: https:\/\/en\.wikipedia\.org\/wiki\/(.*)/', $headers, $matches)) {
header("Location: http://" . $_SERVER["HTTP_HOST"] . "/" . $matches[1]);
exit;
}
Expand All @@ -38,7 +38,7 @@ function curl($url) {
if ($page) {
$class = "page";

$response = curl("http://en.wikipedia.org/wiki/" . urlencode($page));
$response = curl("https://en.wikipedia.org/wiki/" . urlencode($page));
$px = new px($response);

$title = $px->xpath("//h1[@id='firstHeading']")->html();
Expand All @@ -60,7 +60,7 @@ function curl($url) {
else if ($search) {
$class = "search";

$response = curl("http://en.wikipedia.org/w/index.php?search=" . urlencode($search));
$response = curl("https://en.wikipedia.org/w/index.php?search=" . urlencode($search));
$px = new px($response);

$title = "<h1 id='firstHeading'>Search results</h1>";
Expand Down

0 comments on commit 2be0366

Please sign in to comment.