From 1ffa65c88b570aca2b5d3b9b7202e30beeee2fe7 Mon Sep 17 00:00:00 2001
From: root
Date: Fri, 5 Dec 2014 05:06:52 +0100
Subject: Made it ipv6 ready.
---
down/ajax.php | 6 +++---
down/http.php | 10 +++++++++-
down/view/templ-index.php | 16 ++++++++++------
3 files changed, 22 insertions(+), 10 deletions(-)
(limited to 'down')
diff --git a/down/ajax.php b/down/ajax.php
index 63a63d1..f5a4ce6 100644
--- a/down/ajax.php
+++ b/down/ajax.php
@@ -11,9 +11,9 @@ if( !isset($_REQUEST["url"]) || $_REQUEST["url"] == "" ){
exit;
}
-function ipv6($host){
+function ipv6($ip){
- if ( filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) ) {
+ if ( filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) ) {
return true;
}
@@ -40,7 +40,7 @@ switch($_REQUEST["action"]){
if ( !ipv6($_REQUEST["url"]) && filter_var(sanitizeUrl($_REQUEST["url"]), FILTER_VALIDATE_URL, FILTER_FLAG_HOST_REQUIRED) === false ){
echo "not valid";
} else {
- if( isUp($_REQUEST["url"]) ){
+ if( isUp($_REQUEST["url"], ipv6($_REQUEST["url"]) ) ){
$r["status"] = "Looks like it's up from here.";
$r["data"] = 1;
} else {
diff --git a/down/http.php b/down/http.php
index 9973cb4..5e0351d 100644
--- a/down/http.php
+++ b/down/http.php
@@ -1,7 +1,14 @@
-
+
@@ -44,7 +45,7 @@
}
?>
-
+
@@ -116,10 +117,13 @@
$(".fa-spinner").addClass("fa-spin");
- };
+ document.addEventListener('keydown', function(event) {
+ $("#url").focus();
+ });
- function clean(id){
- $(id).val('');
- }
+ $("#clear").click(function(){
+ $("#url").val('').focus();
+ })
+ };
--
cgit v1.2.3