mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-26 08:47:19 +00:00
Compare commits
No commits in common. "cb3382f6d2713ff9d4fe4cf4498ee312f2efa63e" and "7e1da9a5cab3bc4489e9c92eabcad3826d228188" have entirely different histories.
cb3382f6d2
...
7e1da9a5ca
3 changed files with 3 additions and 27 deletions
|
@ -59,10 +59,6 @@ It means that composer will look at `master` branch of repository configured und
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
### 2024-09-21
|
|
||||||
|
|
||||||
- Added wrapper for PDOException to avoid creating dynamic property `queryString`.
|
|
||||||
|
|
||||||
### 2024-07-24
|
### 2024-07-24
|
||||||
|
|
||||||
- Csrf vulnerabity fix back ported from Cake PHP 3
|
- Csrf vulnerabity fix back ported from Cake PHP 3
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
App::uses('DataSource', 'Model/Datasource');
|
App::uses('DataSource', 'Model/Datasource');
|
||||||
App::uses('PDOExceptionWithQueryString', 'Model/Datasource');
|
|
||||||
App::uses('CakeText', 'Utility');
|
App::uses('CakeText', 'Utility');
|
||||||
App::uses('View', 'View');
|
App::uses('View', 'View');
|
||||||
|
|
||||||
|
@ -513,13 +512,12 @@ class DboSource extends DataSource {
|
||||||
}
|
}
|
||||||
return $query;
|
return $query;
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
$wrapperException = new PDOExceptionWithQueryString($e);
|
|
||||||
if (isset($query->queryString)) {
|
if (isset($query->queryString)) {
|
||||||
$wrapperException->queryString = $query->queryString;
|
$e->queryString = $query->queryString;
|
||||||
} else {
|
} else {
|
||||||
$wrapperException->queryString = $sql;
|
$e->queryString = $sql;
|
||||||
}
|
}
|
||||||
throw $wrapperException;
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
class PDOExceptionWithQueryString extends PDOException {
|
|
||||||
|
|
||||||
public string $queryString = "";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Wrapper for PDOException to avoid creating dynamic property.
|
|
||||||
*
|
|
||||||
* @param PDOException $e Source exception.
|
|
||||||
*/
|
|
||||||
public function __construct(PDOException $e) {
|
|
||||||
parent::__construct($e->getMessage(), 0, $e->getPrevious());
|
|
||||||
|
|
||||||
$this->errorInfo = $e->errorInfo;
|
|
||||||
$this->code = $e->code;
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue