Moodle

filter/tex/pix.php should not use error_reporting(E_ALL); or rendering tex fails with php 5.3.X

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9.7, 1.9.8
  • Fix Version/s: 1.9.9
  • Component/s: Filters
  • Labels:
    None

Description

In file filter/tex/pix.php line 29:

error_reporting(E_ALL);

corrupts tex images with php 5.3.X and there are at least 3 easy ways to fix it:

1) To totally remove line 29 and error reporting from that file

2) To change line 29 to:

error_reporting(E_ALL & ~E_DEPRECATED);

so that php 5.3.X does not show the deprecated functions warnings that otherwise would prevent showing of tex images.

3) To fix the related deprecated functions to make sure that tex filter works also with PHP 6 that will not support deprecated features of php 5.3 at all - like recomended in http://php.net/manual/en/migration53.deprecated.php - in this case the changes mentioned in http://moodle.org/mod/forum/discuss.php?d=146787 might do the job (unless they cause some regression with case PARAM_PATH elsewhere)

My suggestion is to use 2) and change line 29 of file filter/tex/pix.php

from

error_reporting(E_ALL);

to

error_reporting(E_ALL & ~E_DEPRECATED);

for now and make all required changes for php 5.3.X deprecated functions later (after modle 2.0 stable release) to quarantee php 6 support

Activity

Hide
Mauno Korpelainen added a comment -

Petr,

similar moodle 2.0 bug was fixed last July http://tracker.moodle.org/browse/MDL-19841 and similar line

error_reporting(E_ALL);

is found also from latest moodle 1.8.12+, moodle 1.7.7 and moodle 1.6.9 file filter/tex/pix.php
so they will all fail to render new tex images with php 5.3.X and similar fix could be made to each of these packages.

Show
Mauno Korpelainen added a comment - Petr, similar moodle 2.0 bug was fixed last July http://tracker.moodle.org/browse/MDL-19841 and similar line error_reporting(E_ALL); is found also from latest moodle 1.8.12+, moodle 1.7.7 and moodle 1.6.9 file filter/tex/pix.php so they will all fail to render new tex images with php 5.3.X and similar fix could be made to each of these packages.
Hide
Petr Škoda (skodak) added a comment -

E_DEPRECATED was introduced in 5.3.0 - it would break stuff in older PHP

Show
Petr Škoda (skodak) added a comment - E_DEPRECATED was introduced in 5.3.0 - it would break stuff in older PHP
Hide
Petr Škoda (skodak) added a comment -

fix committed, please test
thanks a lot for the report!

Show
Petr Škoda (skodak) added a comment - fix committed, please test thanks a lot for the report!

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: