MDL-21407 tex filter - trim leading whitespace from latex preamble. Merged from 19_STABLE

This commit is contained in:
Eloy Lafuente 2010-02-03 09:23:37 +00:00
parent d3d393ab37
commit 073d380425
3 changed files with 12 additions and 3 deletions

View File

@ -8,7 +8,6 @@ $items[] = new admin_setting_configtextarea('filter_tex_latexpreamble', get_stri
'', "\\usepackage[latin1]{inputenc}\n\\usepackage{amsmath}\n\\usepackage{amsfonts}\n\\RequirePackage{amsmath,amssymb,latexsym}\n"); '', "\\usepackage[latin1]{inputenc}\n\\usepackage{amsmath}\n\\usepackage{amsfonts}\n\\RequirePackage{amsmath,amssymb,latexsym}\n");
$items[] = new admin_setting_configtext('filter_tex_latexbackground', get_string('backgroundcolour', 'admin'), '', '#FFFFFF'); $items[] = new admin_setting_configtext('filter_tex_latexbackground', get_string('backgroundcolour', 'admin'), '', '#FFFFFF');
$items[] = new admin_setting_configtext('filter_tex_density', get_string('density', 'admin'), '', '120', PARAM_INT); $items[] = new admin_setting_configtext('filter_tex_density', get_string('density', 'admin'), '', '120', PARAM_INT);
$items[] = new admin_setting_configtext('filter_tex_density', get_string('density', 'admin'), '', '120', PARAM_INT);
if (PHP_OS=='Linux') { if (PHP_OS=='Linux') {
$default_filter_tex_pathlatex = "/usr/bin/latex"; $default_filter_tex_pathlatex = "/usr/bin/latex";

View File

@ -3029,6 +3029,16 @@ WHERE gradeitemid IS NOT NULL AND grademax IS NOT NULL");
} }
upgrade_main_savepoint($result, 2010020300); upgrade_main_savepoint($result, 2010020300);
} }
// MDL-21407. Trim leading spaces from default tex latexpreamble causing problems under some confs
if ($result && $oldversion < 2010020301) {
if ($preamble = $CFG->filter_tex_latexpreamble) {
$preamble = preg_replace('/^ +/m', '', $preamble);
set_config('filter_tex_latexpreamble', $preamble);
}
upgrade_main_savepoint($result, 2010020301);
}
return $result; return $result;
} }

View File

@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine // This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php) // whether upgrades should be performed (see lib/db/*.php)
$version = 2010020300; // YYYYMMDD = date of the last version bump $version = 2010020301; // YYYYMMDD = date of the last version bump
// XX = daily increments // XX = daily increments
$release = '2.0 dev (Build: 20100203)'; // Human-friendly version name $release = '2.0 dev (Build: 20100203)'; // Human-friendly version name