diff --git a/libraries/CommonFunctions.class.php b/libraries/CommonFunctions.class.php index 7e20eb4c78..fb8a9da52e 100644 --- a/libraries/CommonFunctions.class.php +++ b/libraries/CommonFunctions.class.php @@ -3460,6 +3460,10 @@ class PMA_CommonFunctions * * @param string $string Text where to do expansion. * @param function $escape Function to call for escaping variable values. + * Can also be an array of: + * - the escape method name + * - the class that contains the method + * - location of the class (for inclusion) * @param array $updates Array with overrides for default parameters * (obtained from GLOBALS). * @@ -3507,10 +3511,19 @@ class PMA_CommonFunctions /* Optional escaping */ if (! is_null($escape)) { + if (is_array($escape)) { + require_once $escape[2]; + $escape_class = new $escape[1]; + $escape_method = $escape[0]; + } foreach ($replace as $key => $val) { - $replace[$key] = ($escape == 'backquote') - ? $this->$escape($val) - : $escape($val); + if (is_array($escape)) { + $replace[$key] = $escape_class->$escape_method($val); + } else { + $replace[$key] = ($escape == 'backquote') + ? $this->$escape($val) + : $escape($val); + } } } diff --git a/libraries/plugins/export/ExportLatex.class.php b/libraries/plugins/export/ExportLatex.class.php index 947c5b8fed..e5a52baaee 100644 --- a/libraries/plugins/export/ExportLatex.class.php +++ b/libraries/plugins/export/ExportLatex.class.php @@ -311,7 +311,11 @@ class ExportLatex extends ExportPlugin $buffer .= ' \\caption{' . $common_functions->expandUserString( $GLOBALS['latex_data_caption'], - get_class($this) . '->texEscape', + array( + 'texEscape', + get_class($this), + 'libraries/plugins/export/' . get_class($this) . ".class.php" + ), array('table' => $table, 'database' => $db) ) . '} \\label{' @@ -343,7 +347,11 @@ class ExportLatex extends ExportPlugin '\\caption{' . $common_functions->expandUserString( $GLOBALS['latex_data_continued_caption'], - get_class($this) . '->texEscape', + array( + 'texEscape', + get_class($this), + 'libraries/plugins/export/' . get_class($this) . ".class.php" + ), array('table' => $table, 'database' => $db) ) . '} \\\\ ' @@ -513,7 +521,11 @@ class ExportLatex extends ExportPlugin $buffer .= ' \\caption{' . $common_functions->expandUserString( $GLOBALS['latex_structure_caption'], - get_class($this) . '->texEscape', + array( + 'texEscape', + get_class($this), + 'libraries/plugins/export/' . get_class($this) . ".class.php" + ), array('table' => $table, 'database' => $db) ) . '} \\label{' @@ -531,7 +543,11 @@ class ExportLatex extends ExportPlugin $buffer .= ' \\caption{' . $common_functions->expandUserString( $GLOBALS['latex_structure_continued_caption'], - get_class($this) . '->texEscape', + array( + 'texEscape', + get_class($this), + 'libraries/plugins/export/' . get_class($this) . ".class.php" + ), array('table' => $table, 'database' => $db) ) . '} \\\\ ' . $crlf;