Skip to content

Commit

Permalink
Added query escaping in method for getting zone
Browse files Browse the repository at this point in the history
  • Loading branch information
uryvskiy-dima authored Jul 10, 2023
2 parents 22a9c2d + a56ce78 commit a375804
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## v4.1.12
* Added escaping for db query in method for getting zone

## v4.1.11
* Fixed the transfer of the weight offers

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.1.11
4.1.12
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ public function getCountryByIsoCode($isoCode) {
* @return array
*/
public function getZoneByName($name) {
$name = $this->db->escape($name);
$query = $this->db->query("SELECT * FROM `" . DB_PREFIX . "zone` WHERE name = '" . $name . "'");

return $query->row;
Expand Down
2 changes: 2 additions & 0 deletions tests/system/lib/repository/DataRepositoryAdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public function testGetZoneByName() {

$this->assertNotEmpty($zone);
$this->assertNotEmpty($zone['zone_id']);

$repository->getZoneByName('Rostov-na-Do\'nu');
}

public function testGetCurrencyByCode() {
Expand Down

0 comments on commit a375804

Please sign in to comment.