Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit bc5258a

Browse files
committed
MAGETWO-65715: Upgrade zend Framework 1 to 1.12.20
- Merge tag 'release-1.12.19' into MAGETWO-65715-1.12.20
2 parents 4ad4509 + be21131 commit bc5258a

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

CONTRIBUTING.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# CONTRIBUTING
22

3+
> ## End-of-Life occurs 28 Sep 2016
4+
>
5+
> Between now and 28 Sep 2016, we will only be accepting security patches to
6+
> this repository; after that date, we will issue no more releases.
7+
>
8+
> For more information:
9+
>
10+
> - https://framework.zend.com/blog/2016-06-28-zf1-eol.html
11+
12+
---
13+
14+
> ## Contributors License Agreement
15+
>
316
> **To submit code, patches, and proposals to Zend Framework, contributors must
417
agree to the New BSD License and also submit a signed
518
[Contributor License Agreement (CLA)](https://github.com/zendframework/zf1/wiki/Contributor-License-Agreement-%28CLA%29).**
@@ -38,4 +51,4 @@ contributors a chance to resolve the vulnerability and issue a new release prior
3851
to any public exposure; this helps protect Zend Framework users and provides
3952
them with a chance to upgrade and/or update in order to protect their applications.
4053

41-
For sensitive email communications, please use [our PGP key](http://framework.zend.com/zf-security-pgp-key.asc).
54+
For sensitive email communications, please use [our PGP key](http://framework.zend.com/zf-security-pgp-key.asc).

library/Zend/Db/Select.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ class Zend_Db_Select
8181
const SQL_ASC = 'ASC';
8282
const SQL_DESC = 'DESC';
8383

84-
const REGEX_COLUMN_EXPR = '/^([\w]*\s*\(([^\(\)]|(?1))*\))$/';
84+
const REGEX_COLUMN_EXPR = '/^([\w]*\s*\(([^\(\)]|(?1))*\))$/';
85+
const REGEX_COLUMN_EXPR_ORDER = '/^([\w]+\s*\(([^\(\)]|(?1))*\))$/';
86+
const REGEX_COLUMN_EXPR_GROUP = '/^([\w]+\s*\(([^\(\)]|(?1))*\))$/';
8587

8688
/**
8789
* Bind variables for query
@@ -511,7 +513,7 @@ public function group($spec)
511513
}
512514

513515
foreach ($spec as $val) {
514-
if (preg_match(self::REGEX_COLUMN_EXPR, (string) $val)) {
516+
if (preg_match(self::REGEX_COLUMN_EXPR_GROUP, (string) $val)) {
515517
$val = new Zend_Db_Expr($val);
516518
}
517519
$this->_parts[self::GROUP][] = $val;
@@ -603,7 +605,7 @@ public function order($spec)
603605
$val = trim($matches[1]);
604606
$direction = $matches[2];
605607
}
606-
if (preg_match(self::REGEX_COLUMN_EXPR, $val)) {
608+
if (preg_match(self::REGEX_COLUMN_EXPR_ORDER, $val)) {
607609
$val = new Zend_Db_Expr($val);
608610
}
609611
$this->_parts[self::ORDER][] = array($val, $direction);

library/Zend/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ final class Zend_Version
3232
/**
3333
* Zend Framework version identification - see compareVersion()
3434
*/
35-
const VERSION = '1.12.18';
35+
const VERSION = '1.12.19';
3636

3737
/**
3838
* The latest stable version Zend Framework available

tests/Zend/Db/Select/StaticTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,10 @@ public function testSqlInjectionWithOrder()
834834
$select = $this->_db->select();
835835
$select->from(array('p' => 'products'))->order('MD5(1);drop table products; -- )');
836836
$this->assertEquals('SELECT "p".* FROM "products" AS "p" ORDER BY "MD5(1);drop table products; -- )" ASC', $select->assemble());
837+
838+
$select = $this->_db->select();
839+
$select->from('p')->order("MD5(\";(\");DELETE FROM p2; SELECT 1 #)");
840+
$this->assertEquals('SELECT "p".* FROM "p" ORDER BY "MD5("";("");DELETE FROM p2; SELECT 1 #)" ASC', $select->assemble());
837841
}
838842

839843
public function testSqlInjectionWithGroup()
@@ -845,6 +849,10 @@ public function testSqlInjectionWithGroup()
845849
$select = $this->_db->select();
846850
$select->from(array('p' => 'products'))->group('MD5(1); drop table products; -- )');
847851
$this->assertEquals('SELECT "p".* FROM "products" AS "p" GROUP BY "MD5(1); drop table products; -- )"', $select->assemble());
852+
853+
$select = $this->_db->select();
854+
$select->from('p')->group("MD5(\";(\");DELETE FROM p2; SELECT 1 #)");
855+
$this->assertEquals('SELECT "p".* FROM "p" GROUP BY "MD5("";("");DELETE FROM p2; SELECT 1 #)"', $select->assemble());
848856
}
849857

850858
public function testSqlInjectionInColumn()

0 commit comments

Comments
 (0)