. */ require_once 'creole/util/Lob.php'; /** * A class for handling binary LOBs. * * @author Hans Lellelid * @version $Revision: 1.5 $ * @package creole.util */ class Blob extends Lob { /** * Dump the contents of the file using fpassthru(). * * @return void * @throws Exception if no file or contents. */ function dump() { if (!$this->data) { // hmmm .. must be a file that needs to read in if ($this->inFile) { $fp = @fopen($this->inFile, "rb"); if (!$fp) { throw new Exception('Unable to open file: '.$this->inFile); } fpassthru($fp); @fclose($fp); } else { throw new Exception('No data to dump'); } } else { $realdocuroot = str_replace( '\\', '/', $_SERVER['DOCUMENT_ROOT'] ); $docuroot = explode( '/', $realdocuroot ); array_pop( $docuroot ); $pathhome = implode( '/', $docuroot ) . '/'; array_pop( $docuroot ); $pathTrunk = implode( '/', $docuroot ) . '/'; require_once($pathTrunk.'gulliver/system/class.inputfilter.php'); $filter = new InputFilter(); $data = $filter->xssFilterHard($this->data); echo $data; } } }