diff --git a/common.inc.php b/common.inc.php index 0a06319..be79126 100644 --- a/common.inc.php +++ b/common.inc.php @@ -15,10 +15,14 @@ $redis = new Redis(); -if (!$redis->connect($config['host'], $config['port'])) { + +try { + $redis->connect($config['host'], $config['port']); +} catch (Exception $e) { die('ERROR: Could not connect to Redis'); } + if (isset($config['auth'])) { if (!$redis->auth($config['auth'])) { die('ERROR: Authentication failed.'); diff --git a/delete.php b/delete.php index 75164c2..44d6001 100644 --- a/delete.php +++ b/delete.php @@ -24,7 +24,7 @@ require 'header.inc.php'; ?> 30) { + break; + } + if ($_POST['type'] == 'string') { $redis->set($_POST['key'], $_POST['value']); } else if (($_POST['type'] == 'hash') && isset($_POST['hkey'])) { + if (strlen($_POST['hkey']) > 30) { + break; + } + $redis->hSet($_POST['key'], $_POST['hkey'], $_POST['value']); } else if (($_POST['type'] == 'list') && isset($_POST['index'])) { $size = $redis->lSize($_POST['key']); @@ -29,7 +37,7 @@ require 'header.inc.php'; ?> -> +>

-> +>

diff --git a/index.php b/index.php index 4168f19..eacc7c5 100644 --- a/index.php +++ b/index.php @@ -36,6 +36,10 @@ $dirs = array(); foreach ($keys as $key) { + if (strlen($key) > 30) { + continue; + } + $key = explode($config['seperator'], $key); $a = &$dirs; @@ -76,7 +80,7 @@ function print_tree($item, $key, $all, $last) { ?> > - "> 30) { + break; + } + $redis->rename($_POST['old'], $_POST['key']); require 'header.inc.php'; ?> - [R] - [X] - [E] + [R] + [X] + [E] @@ -67,7 +67,7 @@

Type:
-
TTL:
[E]
+
TTL:
[E]
Encoding:
@@ -82,9 +82,9 @@ ?>
- [E] + [E]
- [X] + [X]
$value) { ?> >
- [E] + [E]
- [X] + [X]
>
- [E] + [E]
- [X] + [X]
>
- [E] + [E]
- [X] + [X]
>
- [E] - [X] + [E] + [X]

- Add another value + Add another value