summaryrefslogtreecommitdiffstats
path: root/functions/textual.php
diff options
context:
space:
mode:
authorRemy <relst@relst.nl>2015-03-31 10:41:16 +0200
committerRemy <relst@relst.nl>2015-03-31 10:41:16 +0200
commit294ac6676ec9c02eb741f819fc76e6ed950ceb50 (patch)
tree0ef4029c7e43f4be7e6e75e7ebb34df94c95d6d4 /functions/textual.php
parent0fdb444fccbe3535d8b766446bb95bc1390f6442 (diff)
downloadssl-decoder-294ac6676ec9c02eb741f819fc76e6ed950ceb50.zip
ssl-decoder-294ac6676ec9c02eb741f819fc76e6ed950ceb50.tar.gz
ssl-decoder-294ac6676ec9c02eb741f819fc76e6ed950ceb50.tar.bz2
Use json endpoint internally and add warnings
Diffstat (limited to 'functions/textual.php')
-rw-r--r--functions/textual.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/functions/textual.php b/functions/textual.php
index 93a5838..4a1a48d 100644
--- a/functions/textual.php
+++ b/functions/textual.php
@@ -17,7 +17,20 @@
function pre_dump($var) {
echo "<pre>";
var_dump($var);
- echo "<pre>";
+ echo "</pre>";
+}
+
+function utf8encodeNestedArray($arr) {
+ // json_encode fails with binary data. utf-8 encode that first, some ca's like to encode images in their OID's (verisign, 1.3.6.1.5.5.7.1.12)...
+ $encoded_arr = array();
+ foreach ($arr as $key => $value) {
+ if (is_array($value)) {
+ $encoded_arr[utf8_encode($key)] = utf8encodeNestedArray($value);
+ } else {
+ $encoded_arr[utf8_encode($key)] = utf8_encode($value);
+ }
+ }
+ return $encoded_arr;
}
function startsWith($haystack, $needle) {
@@ -31,7 +44,6 @@ function endsWith($haystack, $needle) {
}
}
-
function get_current_folder(){
$url = $_SERVER['REQUEST_URI'];
$parts = explode('/',$url);