From b44643a66e3e332e80a3e302a630fde924e2f822 Mon Sep 17 00:00:00 2001 From: "Dr. Simon A. Xaies" Date: Wed, 3 Jul 2019 19:26:22 +1000 Subject: [PATCH] More Minor Bug Fixes! --- apiconfig.php | 3 ++- functions.php | 2 +- protocols.php | 28 ++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 protocols.php diff --git a/apiconfig.php b/apiconfig.php index 4eeb8ad..0220520 100755 --- a/apiconfig.php +++ b/apiconfig.php @@ -61,4 +61,5 @@ mkdirSecure(API_PATH_IO_CACHE); mkdirSecure(API_PATH_IO_REFEREE); -?> + +require_once __DIR__ . DIRECTORY_SEPARATOR . 'protocols.php'; diff --git a/functions.php b/functions.php index 1bb371a..16a65aa 100755 --- a/functions.php +++ b/functions.php @@ -845,7 +845,7 @@ function jumpShortenURL($url = '') unset($emails[$finger]); } } - $result = $jumps[$hash = md5($url.$referee.microtime(true))] = array("created" => microtime(true), "last" => microtime(true), 'inactive' => (API_DROP_DAYS_INACTIVE * (3600 * 24)), "short" => API_PROTOCOL.API_HOSTNAME.'/v2/'.$referee . (isset($_REQUEST['username']) && !empty($_REQUEST['username']) ? '?' . $_REQUEST['username'] :''), "domain" => API_PROTOCOL.$referee.'.'.API_HOSTNAME . (isset($_REQUEST['username']) && !empty($_REQUEST['username']) ? '/?' . $_REQUEST['username'] :''), 'url' => $url, 'referee' => $referee, 'timezone' => date_default_timezone_get(), 'data' => array('php' => API_PROTOCOL.$referee.'.'.API_HOSTNAME . '/data/php', 'json' => API_PROTOCOL.$referee.'.'.API_HOSTNAME . '/data/json', 'serial' => API_PROTOCOL.$referee.'.'.API_HOSTNAME . '/data/serial', 'xml' => API_PROTOCOL.$referee.'.'.API_HOSTNAME . '/data/xml')); + $result = $jumps[$hash = md5($url.$referee.microtime(true))] = array("created" => microtime(true), "last" => microtime(true), 'inactive' => (API_DROP_DAYS_INACTIVE * (3600 * 24)), "short" => API_ROOT_PROTOCOL.API_HOSTNAME.'/v2/'.$referee . (isset($_REQUEST['username']) && !empty($_REQUEST['username']) ? '?' . $_REQUEST['username'] :''), "domain" => API_SUB_PROTOCOL.$referee.'.'.API_HOSTNAME . (isset($_REQUEST['username']) && !empty($_REQUEST['username']) ? '/?' . $_REQUEST['username'] :''), 'url' => $url, 'referee' => $referee, 'timezone' => date_default_timezone_get(), 'data' => array('php' => API_SUB_PROTOCOL.$referee.'.'.API_HOSTNAME . '/data/php', 'json' => API_SUB_PROTOCOL.$referee.'.'.API_HOSTNAME . '/data/json', 'serial' => API_SUB_PROTOCOL.$referee.'.'.API_HOSTNAME . '/data/serial', 'xml' => API_SUB_PROTOCOL.$referee.'.'.API_HOSTNAME . '/data/xml')); $emails[$hash] = array('create-username' => $_REQUEST['username'], 'email' => $_REQUEST['email'], 'callback-hits' => $_REQUEST['callback-hits'], 'callback-stats' => $_REQUEST['callback-stats'], 'callback-reports' => $_REQUEST['callback-reports'], 'callback-expires' => $_REQUEST['callback-expires']); if (constant('API_DEPLOYMENT_CALLING') == true) { $calls['create'][$hash][time()] = array_merge(array('ipdata' => $ipdata), $emails[$hash], $jumps[$hash], array('hostname' => parse_url(API_URL, PHP_URL_HOST))); diff --git a/protocols.php b/protocols.php new file mode 100644 index 0000000..64beda4 --- /dev/null +++ b/protocols.php @@ -0,0 +1,28 @@ + + * @version 2.2.1 + * @subpackage shortening-url + * @description Short Link URIs API + * @link http://internetfounder.wordpress.com + * @link http://sourceoforge.net/projects/chronolabsapis/files/jump.labs.coop + * @link https://github.com/Chronolabs-Cooperative/Jump-API-PHP + */ + + define('API_ROOT_PROTOCOL', API_PROTOCOL); + define('API_SUB_PROTOCOL', API_PROTOCOL); + +