/usr/share/php/Horde/Mime/Viewer/Report.php is in php-horde-mime-viewer 2.1.2-1build1.
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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | <?php
/**
* The Horde_Mime_Viewer_Report class is a wrapper used to load the
* appropriate Horde_Mime_Viewer for multipart/report data (RFC 3462).
*
* Copyright 2003-2016 Horde LLC (http://www.horde.org/)
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.horde.org/licenses/lgpl21.
*
* @author Michael Slusarz <slusarz@horde.org>
* @category Horde
* @license http://www.horde.org/licenses/lgpl21 LGPL 2.1
* @package Mime_Viewer
*/
class Horde_Mime_Viewer_Report extends Horde_Mime_Viewer_Base
{
/**
* Constructor.
*
* @param Horde_Mime_Part $mime_part The object with the data to be
* rendered.
* @param array $conf Configuration:
* <pre>
* 'viewer_callback' - (callback) A callback to a factory that will
* return the appropriate viewer for the embedded
* MIME type. Is passed three parameters: the
* current driver object, the MIME part object, and
* the MIME type to use.
* </pre>
*/
public function __construct(Horde_Mime_Part $part, array $conf = array())
{
parent::__construct($part, $conf);
}
/**
* Return the underlying MIME Viewer for this part.
*
* @return mixed A Horde_Mime_Viewer object, or false if not found.
*/
protected function _getViewer()
{
if (!($callback = $this->getConfigParam('viewer_callback'))) {
return false;
}
if (!($type = $this->_mimepart->getContentTypeParameter('report-type'))) {
/* This is a broken RFC 3462 message, since 'report-type' is
* mandatory. Try to determine the report-type by looking at the
* sub-type of the second body part. */
$parts = $this->_mimepart->getParts();
if (!isset($parts[1])) {
return false;
}
$type = $parts[1]->getSubType();
}
return call_user_func($callback, $this, $this->_mimepart, 'message/' . Horde_String::lower($type));
}
}
|