Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2014-03-25 11:23:49 +01:00
commit 1e9bd5d6cf
4 changed files with 43 additions and 4 deletions

View File

@ -44,6 +44,7 @@ phpMyAdmin - ChangeLog
4.1.12.0 (not yet released)
- bug #4334 Add event : datepicker won't open
- bug #4338 Fix missing value error while executing SQL query
- TCPDF library is now optional dependency
4.1.11.0 (2014-03-23)
- bug #4335 reCaptcha problem (4.1.10 regression)

View File

@ -10,6 +10,14 @@ if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Skip the plugin if TCPDF is not available.
*/
if (! file_exists(TCPDF_INC)) {
$GLOBALS['skip_import'] = true;
return;
}
/* Get the export interface */
require_once 'libraries/plugins/ExportPlugin.class.php';
/* Get the PMA_ExportPdf class */
@ -265,4 +273,4 @@ class ExportPdf extends ExportPlugin
$this->_pdfReportTitle = $pdfReportTitle;
}
}
?>
?>

View File

@ -9,6 +9,21 @@ if (! defined('PHPMYADMIN')) {
exit;
}
/**
* Skip the plugin if TCPDF is not available.
*/
if (! file_exists(TCPDF_INC)) {
$GLOBALS['skip_import'] = true;
return;
}
/**
* block attempts to directly run this script
*/
if (getcwd() == dirname(__FILE__)) {
die('Attack stopped');
}
require_once 'Export_Relation_Schema.class.php';
require_once './libraries/PDF.class.php';

View File

@ -419,12 +419,19 @@ class PMA_User_Schema
$htmlString .= PMA_Util::getImage('b_views.png');
}
/*
* TODO: This list should be generated dynamically based on list of
* available plugins.
*/
$htmlString .= __('Display relational schema')
. ':'
. '</legend>'
. '<select name="export_type" id="export_type">'
. '<option value="pdf" selected="selected">PDF</option>'
. '<option value="svg">SVG</option>'
. '<select name="export_type" id="export_type">';
if (file_exists(TCPDF_INC)) {
$htmlString .= '<option value="pdf" selected="selected">PDF</option>';
}
$htmlString .=
'<option value="svg">SVG</option>'
. '<option value="dia">DIA</option>'
. '<option value="eps">EPS</option>'
. '</select>'
@ -663,7 +670,15 @@ class PMA_User_Schema
__('File doesn\'t exist')
);
}
$GLOBALS['skip_import'] = false;
include $filename;
if ( $GLOBALS['skip_import']) {
PMA_Export_Relation_Schema::dieSchema(
$_POST['chpage'],
$export_type,
__('Plugin is disabled')
);
}
$class_name = 'PMA_' . $path . '_Relation_Schema';
$obj_schema = new $class_name();
$obj_schema->showOutput();