diff --git a/ext/pdf/pdf.c b/ext/pdf/pdf.c index 7d71cff6813..78f678f8735 100644 --- a/ext/pdf/pdf.c +++ b/ext/pdf/pdf.c @@ -254,31 +254,21 @@ static void _free_pdf_doc(zend_rsrc_list_entry *rsrc TSRMLS_DC) static void custom_errorhandler(PDF *p, int type, const char *shortmsg) { TSRMLS_FETCH(); - switch (type){ - case PDF_NonfatalError: - /* - * PDFlib warnings should be visible to the user. - * If he decides to live with PDFlib warnings - * he may use the PDFlib function - * pdf_set_parameter($p, "warning" 0) to switch off - * the warnings inside PDFlib. - */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal PDFlib warning: %s", shortmsg); - return; - case PDF_MemoryError: /* give up in all other cases */ - case PDF_IOError: - case PDF_RuntimeError: - case PDF_IndexError: - case PDF_TypeError: - case PDF_DivisionByZero: - case PDF_OverflowError: - case PDF_SyntaxError: - case PDF_ValueError: - case PDF_SystemError: - case PDF_UnknownError: - default: - php_error_docref(NULL TSRMLS_CC, E_ERROR,"PDFlib error: %s", shortmsg); - } + + if (type == PDF_NonfatalError) { + /* + * PDFlib warnings should be visible to the user. + * If he decides to live with PDFlib warnings + * he may use the PDFlib function + * pdf_set_parameter($p, "warning" 0) to switch off + * the warnings inside PDFlib. + */ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal PDFlib warning: %s", shortmsg); + return; + } else { + /* give up in all other cases */ + php_error_docref(NULL TSRMLS_CC, E_ERROR,"PDFlib error: %s", shortmsg); + } } /* }}} */