Bug #18520 » indexed_search_7969_t3_trunk.patch

Administrator Admin, 2011-01-18 13:57

View differences:

indexed_search/class.external_parser.php 2010-11-30 11:58:50.000000000 +0100
117 117
		}
118 118

  
119 119
		$safeModeEnabled = t3lib_utility_PhpOptions::isSafeModeEnabled();
120
		$openBasedirEnabled = t3lib_utility_PhpOptions::getIniValueBoolean('open_basedir');
120 121

  
121 122
			// Switch on file extension:
122 123
		switch($extension)	{
......
124 125
					// PDF
125 126
				if ($indexerConfig['pdftools'])	{
126 127
					$pdfPath = rtrim($indexerConfig['pdftools'], '/').'/';
127
					if ($safeModeEnabled || (@is_file($pdfPath . 'pdftotext' . $exe) && @is_file($pdfPath . 'pdfinfo' . $exe))) {
128
					if ($safeModeEnabled || $openBasedirEnabled || (@is_file($pdfPath . 'pdftotext' . $exe) && @is_file($pdfPath . 'pdfinfo' . $exe))) {
128 129
						$this->app['pdfinfo'] = $pdfPath.'pdfinfo'.$exe;
129 130
						$this->app['pdftotext'] = $pdfPath.'pdftotext'.$exe;
130 131
							// PDF mode:
......
137 138
					// Catdoc
138 139
				if ($indexerConfig['catdoc'])	{
139 140
					$catdocPath = rtrim($indexerConfig['catdoc'], '/').'/';
140
					if ($safeModeEnabled || @is_file($catdocPath . 'catdoc' . $exe)) {
141
					if ($safeModeEnabled || $openBasedirEnabled || @is_file($catdocPath . 'catdoc' . $exe)) {
141 142
						$this->app['catdoc'] = $catdocPath.'catdoc'.$exe;
142 143
						$extOK = TRUE;
143 144
					} else $this->pObj->log_setTSlogMessage(sprintf($this->sL('LLL:EXT:indexed_search/locallang.xml:catdocNotFound'), $catdocPath), 3);
......
148 149
					// ppthtml
149 150
				if ($indexerConfig['ppthtml'])	{
150 151
					$ppthtmlPath = rtrim($indexerConfig['ppthtml'], '/').'/';
151
					if ($safeModeEnabled || @is_file($ppthtmlPath . 'ppthtml' . $exe)) {
152
					if ($safeModeEnabled || $openBasedirEnabled || @is_file($ppthtmlPath . 'ppthtml' . $exe)) {
152 153
						$this->app['ppthtml'] = $ppthtmlPath.'ppthtml'.$exe;
153 154
						$extOK = TRUE;
154 155
					} else $this->pObj->log_setTSlogMessage(sprintf($this->sL('LLL:EXT:indexed_search/locallang.xml:ppthtmlNotFound'), $ppthtmlPath), 3);
......
158 159
					// Xlhtml
159 160
				if ($indexerConfig['xlhtml'])	{
160 161
					$xlhtmlPath = rtrim($indexerConfig['xlhtml'], '/').'/';
161
					if ($safeModeEnabled || @is_file($xlhtmlPath . 'xlhtml' . $exe)) {
162
					if ($safeModeEnabled || $openBasedirEnabled || @is_file($xlhtmlPath . 'xlhtml' . $exe)) {
162 163
						$this->app['xlhtml'] = $xlhtmlPath.'xlhtml'.$exe;
163 164
						$extOK = TRUE;
164 165
					} else $this->pObj->log_setTSlogMessage(sprintf($this->sL('LLL:EXT:indexed_search/locallang.xml:xlhtmlNotFound'), $xlhtmlPath), 3);
......
172 173
			case 'odt':		// Oasis OpenDocument Text
173 174
				if ($indexerConfig['unzip'])	{
174 175
					$unzipPath = rtrim($indexerConfig['unzip'], '/').'/';
175
					if ($safeModeEnabled || @is_file($unzipPath . 'unzip' . $exe)) {
176
					if ($safeModeEnabled || $openBasedirEnabled || @is_file($unzipPath . 'unzip' . $exe)) {
176 177
						$this->app['unzip'] = $unzipPath.'unzip'.$exe;
177 178
						$extOK = TRUE;
178 179
					} else $this->pObj->log_setTSlogMessage(sprintf($this->sL('LLL:EXT:indexed_search/locallang.xml:unzipNotFound'), $unzipPath), 3);
179 180
				} else $this->pObj->log_setTSlogMessage($this->sL('LLL:EXT:indexed_search/locallang.xml:unzipDisabled'), 1);
180 181
			break;
181 182
			case 'rtf':
182
					// Catdoc
183
					// Unrtf
183 184
				if ($indexerConfig['unrtf'])	{
184 185
					$unrtfPath = rtrim($indexerConfig['unrtf'], '/').'/';
185
					if ($safeModeEnabled || @is_file($unrtfPath . 'unrtf' . $exe)) {
186
					if ($safeModeEnabled || $openBasedirEnabled || @is_file($unrtfPath . 'unrtf' . $exe)) {
186 187
						$this->app['unrtf'] = $unrtfPath.'unrtf'.$exe;
187 188
						$extOK = TRUE;
188 189
					} else $this->pObj->log_setTSlogMessage(sprintf($this->sL('LLL:EXT:indexed_search/locallang.xml:unrtfNotFound'), $unrtfPath), 3);
(6-6/7)