rtf-html-php
rtf-html-php copied to clipboard
Testing rtf before parsing
Is there some hidden method of checking is RTF is valid before parsing it? I am running into issues with flooding my error handler with notices, as my third party RTF provider (an old system) is handing over badly formatted RTF.
It would be great if I could to something like this
$document = new Document();
if ($document->valid($rtf)) {
$parsed = $document->Parse($rtf);
}
Also it would be nice if Document didn't both trigger a trigger_error as well throw an exception. This will hand off the error twice to my error handler (well only once if I catch it). An exception should be enough I would imagine? :)
+1 on removing the trigger_error
, that would also let @Sinnbeck solve his error spam problem with a try/catch around Parse.