Browse Source

better json formatting

main
Aaron Parecki 7 years ago
parent
commit
8ec4ae6306
No known key found for this signature in database GPG Key ID: 276C2817346D6056
3 changed files with 4 additions and 4 deletions
  1. +1
    -1
      controllers/API.php
  2. +2
    -1
      public/assets/styles.css
  3. +1
    -2
      views/webmention-details.php

+ 1
- 1
controllers/API.php View File

@ -18,7 +18,7 @@ class API {
$response->headers->set($k, $v);
}
$response->headers->set('Content-Type', 'application/json');
$response->setContent(json_encode($params));
$response->setContent(json_encode($params, JSON_UNESCAPED_SLASHES));
return $response;
}

+ 2
- 1
public/assets/styles.css View File

@ -45,5 +45,6 @@ h2.site-name:hover .edit-site {
}
table.logs pre {
white-space: normal;
word-wrap: break-word;
word-break: break-all;
}

+ 1
- 2
views/webmention-details.php View File

@ -111,8 +111,7 @@
<pre style="font-size: 10px;"><?
$json = @json_decode($status->raw_response);
if($json) {
$pretty = new Camspiers\JsonPretty\JsonPretty;
echo $this->e($pretty->prettify($json, null, " "));
echo json_encode($json, JSON_UNESCAPED_SLASHES+JSON_PRETTY_PRINT);
} else {
echo $this->e($status->raw_response);
}

Loading…
Cancel
Save