Skip to content

Commit

Permalink
Like this, DATETIME_FORMAT could be overriden Partial Fix BeSimple#68
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Veroux authored and Jan Markmann committed Nov 4, 2015
1 parent 4279a64 commit 12c5e3d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/BeSimple/SoapServer/WsSecurityFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function filterRequest(CommonSoapRequest $request)
$expires = $xpath->query($query, $security)->item(0);

if (null !== $expires) {
$expiresDatetime = \DateTime::createFromFormat(self::DATETIME_FORMAT, $expires->textContent, new \DateTimeZone('UTC'));
$expiresDatetime = \DateTime::createFromFormat(static::DATETIME_FORMAT, $expires->textContent, new \DateTimeZone('UTC'));
$currentDatetime = new \DateTime('now', new \DateTimeZone('UTC'));

if ($currentDatetime > $expiresDatetime) {
Expand Down Expand Up @@ -170,7 +170,7 @@ public function filterResponse(CommonSoapResponse $response)

// init timestamp
$dt = new \DateTime('now', new \DateTimeZone('UTC'));
$createdTimestamp = $dt->format(self::DATETIME_FORMAT);
$createdTimestamp = $dt->format(static::DATETIME_FORMAT);

// create security header
$security = $filterHelper->createElement(Helper::NS_WSS, 'Security');
Expand All @@ -182,7 +182,7 @@ public function filterResponse(CommonSoapResponse $response)
$timestamp->appendChild($created);
if (null !== $this->expires) {
$dt->modify('+' . $this->expires . ' seconds');
$expiresTimestamp = $dt->format(self::DATETIME_FORMAT);
$expiresTimestamp = $dt->format(static::DATETIME_FORMAT);
$expires = $filterHelper->createElement(Helper::NS_WSU, 'Expires', $expiresTimestamp);
$timestamp->appendChild($expires);
}
Expand Down

0 comments on commit 12c5e3d

Please sign in to comment.