13 * to license@zend.com so we can send you a copy immediately. |
13 * to license@zend.com so we can send you a copy immediately. |
14 * |
14 * |
15 * @category Zend |
15 * @category Zend |
16 * @package Zend_Search_Lucene |
16 * @package Zend_Search_Lucene |
17 * @subpackage Document |
17 * @subpackage Document |
18 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
18 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
19 * @license http://framework.zend.com/license/new-bsd New BSD License |
20 * @version $Id: OpenXml.php 24593 2012-01-05 20:35:02Z matthew $ |
20 * @version $Id$ |
21 */ |
21 */ |
22 |
22 |
23 |
23 |
24 /** Zend_Search_Lucene_Document */ |
24 /** Zend_Search_Lucene_Document */ |
25 require_once 'Zend/Search/Lucene/Document.php'; |
25 require_once 'Zend/Search/Lucene/Document.php'; |
26 |
26 |
|
27 /** Zend_Xml_Security */ |
|
28 require_once 'Zend/Xml/Security.php'; |
27 |
29 |
28 /** |
30 /** |
29 * OpenXML document. |
31 * OpenXML document. |
30 * |
32 * |
31 * @category Zend |
33 * @category Zend |
32 * @package Zend_Search_Lucene |
34 * @package Zend_Search_Lucene |
33 * @subpackage Document |
35 * @subpackage Document |
34 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) |
36 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
35 * @license http://framework.zend.com/license/new-bsd New BSD License |
37 * @license http://framework.zend.com/license/new-bsd New BSD License |
36 */ |
38 */ |
37 abstract class Zend_Search_Lucene_Document_OpenXml extends Zend_Search_Lucene_Document |
39 abstract class Zend_Search_Lucene_Document_OpenXml extends Zend_Search_Lucene_Document |
38 { |
40 { |
39 /** |
41 /** |
81 { |
83 { |
82 // Data holders |
84 // Data holders |
83 $coreProperties = array(); |
85 $coreProperties = array(); |
84 |
86 |
85 // Read relations and search for core properties |
87 // Read relations and search for core properties |
86 $relations = simplexml_load_string($package->getFromName("_rels/.rels")); |
88 $relations = Zend_Xml_Security::scan($package->getFromName("_rels/.rels")); |
87 foreach ($relations->Relationship as $rel) { |
89 foreach ($relations->Relationship as $rel) { |
88 if ($rel["Type"] == Zend_Search_Lucene_Document_OpenXml::SCHEMA_COREPROPERTIES) { |
90 if ($rel["Type"] == Zend_Search_Lucene_Document_OpenXml::SCHEMA_COREPROPERTIES) { |
89 // Found core properties! Read in contents... |
91 // Found core properties! Read in contents... |
90 $contents = simplexml_load_string( |
92 $contents = Zend_Xml_Security::scan( |
91 $package->getFromName(dirname($rel["Target"]) . "/" . basename($rel["Target"])) |
93 $package->getFromName(dirname($rel["Target"]) . "/" . basename($rel["Target"])) |
92 ); |
94 ); |
93 |
95 |
94 foreach ($contents->children(Zend_Search_Lucene_Document_OpenXml::SCHEMA_DUBLINCORE) as $child) { |
96 foreach ($contents->children(Zend_Search_Lucene_Document_OpenXml::SCHEMA_DUBLINCORE) as $child) { |
95 $coreProperties[$child->getName()] = (string)$child; |
97 $coreProperties[$child->getName()] = (string)$child; |