Skip to content

Commit

Permalink
More config-records are selected than it should
Browse files Browse the repository at this point in the history
The "%" in the LIKE-statement selects more config-records than it should.
For example, if you have 2 themes "mytheme" and "mytheme-mobile" and lets say "mytheme" is the active one, this query selects all configs from both themes, because LIKE "mytheme%" also matches "mytheme-mobile".
Whats the purpose of this "%" anyway?
  • Loading branch information
JaroslavHerber authored Apr 6, 2020
1 parent 0eff78f commit 0863e20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/Core/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ protected function _loadVarsFromDb($shopId, $onlyVars = null, $module = '') // p

if ($module) {
$select .= " oxmodule LIKE :oxmodule";
$params[':oxmodule'] = $module . "%";
$params[':oxmodule'] = $module;
} else {
$select .= "oxmodule = ''";
}
Expand Down

0 comments on commit 0863e20

Please sign in to comment.