Topic on Extension talk:Pdf Export

Bug in PdfConverterFactory

2
212.123.142.155 (talkcontribs)

Hi there,

Today I installed this plugin, but not without some hassle! I found a bug in converters/PdfConverterFactory.php:

                if ($wgPdfExportHtmlDocPath) {
                        $output = array();
                        $return_val = null;
                        exec($wgPdfExportHtmlDocPath.' --version', $output, $return_val);

                        if ($return_val === 0) {
                                return new HtmlDocPdfConverter();
                        }
                }

should be:

                if ($wgPdfExportHtmlDocPath) {
                        $output = array();
                        $return_val = null;
                        exec($wgPdfExportHtmlDocPath.' --version', $output, $return_val);

                        if ($return_val !== 0) {
                                return new HtmlDocPdfConverter();
                        }
                }

note the === and !==. Now the code works like a charm, thanks!

59.99.217.217 (talkcontribs)

Any non zero return value is an error. The code should not be changed as above.

Reply to "Bug in PdfConverterFactory"