summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Bratch <l_bratch@yahoo.co.uk>2014-07-23 18:14:58 +0100
committerLuke Bratch <l_bratch@yahoo.co.uk>2014-07-23 18:14:58 +0100
commitbb5e67eb0f7599683cdaf6f2f693e7b5c7aff56c (patch)
tree8cc31f0c6cea28ff95b175e4a9e93b79dcb1f0bf
parent2e019a75fc16f20a2c0dffebea02994e0dec057b (diff)
Ensure all filenames are UTF-8 encoded and also add a raw output mode
-rw-r--r--index.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/index.php b/index.php
index f84f961..37f6844 100644
--- a/index.php
+++ b/index.php
@@ -237,7 +237,7 @@ while ($this_array = each($new_array)){
break;
}
- $listing[$listsize]['filename'] = $value;
+ $listing[$listsize]['filename'] = utf8_encode($value);
$listing[$listsize]['type'] = $icon;
$listing[$listsize]['modified'] = $key;
$listing[$listsize]['size'] = $size_array[$key];
@@ -286,5 +286,7 @@ for ($i = 0; $i < count($listing); $i++) {
<?php
} else if ($_GET['format'] == "json") {
echo json_encode($listing);
+} else if ($_GET['format'] == "raw") {
+ print_r($listing);
}
?>