Skip to content

Commit

Permalink
Improved method replaceTVCondition
Browse files Browse the repository at this point in the history
  • Loading branch information
bezumkin committed Sep 12, 2013
1 parent 44775c5 commit 43f662a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/components/pdotools/model/pdotools/pdofetch.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ public function replaceTVCondition(array $array) {

if (!empty($tvs)) {
foreach ($array as $k => $v) {
$tmp = preg_replace('/\b('.$tvs.')\b/i', '`TV$1`.`value`', $k);
$tmp = preg_replace_callback('/\b('.$tvs.')\b/i', function($matches) {
return '`TV'.strtolower($matches[1]).'`.`value`';
}, $k);
if ($tmp != $k) {
$array[$tmp] = $v;
unset($array[$k]);
Expand Down

0 comments on commit 43f662a

Please sign in to comment.