Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing rtf before parsing #66

Open
sinnbeck opened this issue Nov 18, 2019 · 1 comment
Open

Testing rtf before parsing #66

sinnbeck opened this issue Nov 18, 2019 · 1 comment

Comments

@sinnbeck
Copy link

sinnbeck commented Nov 18, 2019

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? :)

@Leshana
Copy link
Contributor

Leshana commented Jan 6, 2020

+1 on removing the trigger_error, that would also let @sinnbeck solve his error spam problem with a try/catch around Parse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants