PluginProbe
E2Pdf – Export Pdf Tool for WordPress / 1.32.49
E2Pdf – Export Pdf Tool for WordPress v1.32.49
1.32.49 1.32.48 1.32.43 1.32.40 1.32.34 1.32.32 1.32.31 1.32.26 1.32.22 1.32.23 1.32.18 1.32.17 1.32.15 trunk 1.00.00 1.00.13 1.01.01 1.02.02 1.03.07 1.04.07 1.05.03 1.06.02 1.07.11 1.08.00 1.08.06 All 72 releases
← All changes | classes/helper/e2pdf-xml.php +17 -4 1.32.151.32.49 View file →
@@ -13,9 +13,14 @@
13 13
14 14 class Helper_E2pdf_Xml {
15 15
16 16 private $xml;
17 + private $helper;
17 18
19 + public function __construct() {
20 + $this->helper = Helper_E2pdf_Helper::instance();
21 + }
22 +
18 23 // check
19 24 public function check() {
20 25 if (extension_loaded('simplexml')) {
21 26 return true;
@@ -165,15 +170,23 @@
165 170
166 171 // parse xml font
167 172 public function parse_xml_font($font) {
168 173
174 + if (!$font) {
175 + return;
176 + }
177 +
178 + $font_title = isset($font->title) ? (string) $font->title : '';
179 + $font_name = isset($font->name) ? (string) $font->name : '';
180 + $font_value = isset($font->value) ? (string) $font->value : '';
181 +
182 + if (!$font_title || !$font_name || !$font_value) {
183 + return;
184 + }
185 +
169 186 $model_e2pdf_font = new Model_E2pdf_Font();
170 187 $fonts = $model_e2pdf_font->get_fonts();
171 188 $fonts_dir = $this->helper->get('fonts_dir');
172 -
173 - $font_title = (string) $font->title;
174 - $font_name = (string) $font->name;
175 - $font_value = (string) $font->value;
176 189
177 190 $exist = array_search($font_title, $fonts, true);
178 191 if ($exist === false) {
179 192 if (!file_exists($fonts_dir . $font_name)) {