Skip to content

Commit 9860741

Browse files
committedMay 31, 2015
- Fixed possible E_WARNING on line 319 and 249 of pdoTools class.
- Disabled system option "pdotools_fenom_modx" by default due to security issues. Version 2.0.1-pl
1 parent c05dfb4 commit 9860741

File tree

5 files changed

+15
-8
lines changed

5 files changed

+15
-8
lines changed
 

‎_build/build.config.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
define('PKG_NAME','pdoTools');
55
define('PKG_NAME_LOWER',strtolower(PKG_NAME));
66

7-
define('PKG_VERSION','2.0.0');
7+
define('PKG_VERSION','2.0.1');
88
define('PKG_RELEASE','pl');
99
define('PKG_AUTO_INSTALL', true);
1010

‎_build/data/transport.settings.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
),
3434
'fenom_modx' => array(
3535
'xtype' => 'combo-boolean',
36-
'value' => true,
36+
'value' => false,
3737
),
3838
'fenom_options' => array(
3939
'xtype' => 'textarea',

‎core/components/pdotools/docs/changelog.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
Changelog for pdoTools.
22

3+
2.0.1 pl
4+
==============
5+
- Fixed possible E_WARNING on line 319 and 349 of pdoTools class.
6+
- Disabled system option "pdotools_fenom_modx" by default due to security issues.
7+
38
2.0.0 pl
49
==============
510
- New system settings to control the Fenom.

‎core/components/pdotools/model/pdotools/pdoparser.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function __construct(xPDO &$modx) {
4444
*/
4545
public function processElementTags($parentTag, & $content, $processUncacheable = false, $removeUnprocessed = false, $prefix = "[[", $suffix = "]]", $tokens = array(), $depth = 0) {
4646

47-
if (is_string($content) && empty($parentTag) && $processUncacheable && $this->modx->getOption('pdotools_fenom_parser', null, true)) {
47+
if (is_string($content) && empty($parentTag) && $processUncacheable && !empty($this->pdoTools->config['useFenomParser'])) {
4848
$content = $this->pdoTools->fenom($content, $this->modx->placeholders);
4949
}
5050

‎core/components/pdotools/model/pdotools/pdotools.class.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ public function setConfig(array $config = array(), $clean_timings = true) {
7676
$this->config['scheme'] = $this->modx->getOption('link_tag_scheme');
7777
}
7878
$this->config['useFenom'] = $this->modx->getOption('pdotools_fenom_default', null, true);
79+
$this->config['useFenomParser'] = $this->modx->getOption('pdotools_fenom_parser', null, false);
7980
$this->config['useFenomCache'] = $this->modx->getOption('pdotools_fenom_cache', null, false);
81+
$this->config['useFenomMODX'] = $this->modx->getOption('pdotools_fenom_modx', null, false);
8082
}
8183

8284

@@ -313,8 +315,8 @@ public function getChunk($name = '', array $properties = array(), $fastMode = fa
313315
}
314316

315317
$content = $this->config['useFenom']
316-
? $this->fenom($chunk, $properties)
317-
: $content = $chunk['content'];
318+
? $this->fenom($chunk['content'], $properties)
319+
: $chunk['content'];
318320

319321
if (strpos($content, '[[') !== false) {
320322
// Processing quick placeholders
@@ -386,8 +388,8 @@ public function parseChunk($name = '', array $properties = array(), $prefix = '[
386388
}
387389

388390
$content = $this->config['useFenom']
389-
? $this->fenom($chunk, $properties)
390-
: $content = $chunk['content'];
391+
? $this->fenom($chunk['content'], $properties)
392+
: $chunk['content'];
391393

392394
if (strpos($content, '[[') !== false) {
393395
$pl = $this->makePlaceholders($properties, '', $prefix, $suffix);
@@ -464,7 +466,7 @@ public function fenom($chunk, array $properties = array()) {
464466

465467
if ($tpl instanceof Fenom\Render) {
466468
$properties['_pls'] = $properties;
467-
if ($this->modx->getOption('pdotools_fenom_modx', null, true)) {
469+
if (!empty($this->config['useFenomMODX'])) {
468470
$properties['modx'] = $this->modx;
469471
$properties['pdoTools'] = $this;
470472
}

0 commit comments

Comments
 (0)