/usr/share/php/Horde/Controller/ResponseWriter/WebDebug.php is in php-horde-controller 2.0.1-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | <?php
/**
* @category Horde
* @package Controller
* @author James Pepin <james@bluestatedigital.com>
* @license http://www.horde.org/licenses/bsd BSD
*/
class Horde_Controller_ResponseWriter_WebDebug implements Horde_Controller_ResponseWriter
{
public function writeResponse(Horde_Controller_Response $response)
{
$headerHtml = '<div><strong>Headers:</strong><pre>';
$headers = $response->getHeaders();
foreach ($headers as $key => $value) {
$headerHtml .= htmlspecialchars("$key: $value\n");
}
echo $headerHtml . '</pre></div>';
if (isset($headers['Location'])) {
echo '<p>Redirect To: <a href="' . htmlspecialchars($headers['Location']) . '">' . htmlspecialchars($headers['Location']) . '</a></p>';
}
$body = $response->getBody();
if (is_resource($body)) {
$body = stream_get_contents($body);
}
if (isset($headers['Content-Encoding']) && $headers['Content-Encoding'] == 'gzip') {
// Strip off the header and inflate it
echo gzinflate(substr($body, 10));
} else {
echo $body;
}
}
}
|