Pues mira en el archivo y la lìnea que me marca el error esta este còdigo:
Código php:
Ver original<?php
class Container {
var $rtf;
var $pard = '\pard ';
var $emptyPar = false;
function Container(&$rtf) {
$this->rtf = &$rtf;
}
function writeRtfCode($text) {
$this->elements[] = $text;
}
function emptyParagraph(&$font, &$parFormat) {
if (is_a($parFormat, 'ParFormat') && is_a($font, 'Font')) { $content = (count($this->elements) != 0 && empty($this->emptyPar)) ?
'\par ' : ''; $content .= $this->pard.$parFormat->getContent($this->rtf);
$content .= '{'.$font->getContent($this->rtf).' \par}'."\r\n";
$this->elements[] = $content;
$this->emptyPar = true;
}
}
function writeText($text, &$font, &$parFormat, $replaceTags = true) {
if (!empty($replaceTags)) { //bold
$text = preg_replace("/<STRONG[ ]*>(.*?)<\/STRONG[ ]*>/mi", "\\b \\1\\b0 ", $text); $text = preg_replace("/<B[ ]*>(.*?)<\/B[ ]*>/mi", "\\b \\1\\b0 ", $text); //italic
$text = preg_replace("/<EM[ ]*>(.*?)<\/EM[ ]*>/mi", "\\i \\1\\i0 ", $text); $text = preg_replace("/<I[ ]*>(.*?)<\/I[ ]*>/mi", "\\i \\1\\i0 ", $text); //underline
$text = preg_replace("/<U[ ]*>(.*?)<\/U[ ]*>/mi", "\\ul \\1\\ul0 ", $text); //break
$text = preg_replace("/<BR[ ]*(\/)?[ ]*>/mi", "\\line ", $text); $text = preg_replace("/<CHDATE[ ]*(\/)?[ ]*>/mi", "\\chdate ", $text); $text = preg_replace("/<CHDPL[ ]*(\/)?[ ]*>/mi", "\\\chdpl ", $text); $text = preg_replace("/<CHDPA[ ]*(\/)?[ ]*>/mi", "\\chdpa ", $text); $text = preg_replace("/<CHTIME[ ]*(\/)?[ ]*>/mi", "\\chtime ", $text); $text = preg_replace("/<CHPGN[ ]*(\/)?[ ]*>/mi", "\\chpgn ", $text);
$text = preg_replace("/<TAB[ ]*(\/)?[ ]*>/mi", "\\tab ", $text); $text = preg_replace("/<BULLET[ ]*(\/)?[ ]*>/mi", "\\bullet ", $text);
$text = preg_replace("/<PAGENUM[ ]*(\/)?[ ]*>/mi", "\\chpgn ", $text); $text = preg_replace("/<SECTNUM[ ]*(\/)?[ ]*>/mi", "\\sectnum ", $text);
$text = preg_replace("/<LINE[ ]*(\/)?[ ]*>/mi", "\\line ", $text); //$text = preg_replace("/<PAGE[ ]*(\/)?[ ]*>/mi", "\\page ", $text);
//$text = preg_replace("/<SECT[ ]*(\/)?[ ]*>/mi", "\\sect", $text);
}
$text = Util::utf8Unicode($text);
//content formating
$content = (is_a($parFormat, 'ParFormat') && count($this->elements) != 0 && empty($this->emptyPar)) ?
'\par ' : ''; $this->emptyPar = false;
$content .= is_a($parFormat, 'ParFormat') ?
$this->pard.$parFormat->getContent($this->rtf) : ''; $content .= '{';
if (is_a($font, 'Font')) { $content .= $font->getContent($this->rtf);
}
$content .= $text.'}'."\r\n";
$this->elements[] = $content;
}
function writeHyperLink($hyperlink, $text, &$font, &$parFormat) {
$content = (is_a($parFormat, 'ParFormat') && count($this->elements) != 0) && empty($this->emptyPar) ?
'\par ' : ''; $this->emptyPar = false;
$content .= is_a($parFormat, 'ParFormat') ?
$this->pard.$parFormat->getContent($this->rtf) : '';
$this->elements[] = $content.'{\field {\*\fldinst {HYPERLINK "'.$hyperlink.'"}}{\\fldrslt {';
$null = null;
$this->writeText($text, $font, $null);
$this->elements[] .= '}}}'."\r\n";
}
function &addTable($alignment = 'left') {
$this->emptyPar = false;
$table = new Table($this, $alignment);
$this->elements[] = &$table;
return $table;
}
function &addImage($fileName, &$parFormat, $width = 0, $height = 0) {
$this->emptyPar = false;
$image = new Image($this->rtf, $fileName, $parFormat, $width, $height);
$this->elements[] = &$image;
return $image;
}
function getContent() {
$content = '';
foreach($this->elements as $key => $value) {
$content .= $value;
} else {
if ($key != 0
&& !is_a($this->elements[$key - 1], 'Table')) {
$content .= '\par';
} else if (is_a($value, 'Image')) { if (is_a($value->parFormat, 'ParFormat')) { $content .= $key != 0 ? '\par' : '';
$content .= $this->pard.$value->parFormat->getContent($this->rtf);
}
}
$content .= $value->getContent();
}
}
return $content;
}
}
?>
La lìnea en la que me marca el error es:
$content = (is_a($parFormat, 'ParFormat') && count($this->elements) != 0 && empty($this->emptyPar)) ? '\par ' : '';