Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing Segmentation Fault #31

Merged
merged 1 commit into from
May 2, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

if [[ $TRAVIS_PHP_VERSION = 7.* ]]; then
phpdbg -qrr ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
else
./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
fi
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
language: php

php:
- 5.5
- 5.6
- 7.0

before_script:
- chmod a+x ./.travis.sh
- composer self-update
- composer install --no-ansi
- wget https://scrutinizer-ci.com/ocular.phar
- mkdir -p build/logs

script:
- phpdbg -qrr ./vendor/bin/phpunit --coverage-clover build/logs/clover.xml
- ./.travis.sh
- composer cs

after_script:
Expand Down
19 changes: 13 additions & 6 deletions src/API/NTLMSoapClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,25 @@ public function __call($name, $args)
$args[0] = $args[0]->toXmlObject();
}

$this->__default_headers = array (
$headers = array (
$this->ewsHeaders['version'],
$this->ewsHeaders['impersonation']
$this->ewsHeaders['impersonation'],
);

if (!in_array($name, $this->callsWithoutTimezone)) {
$this->__default_headers[] = $this->ewsHeaders['timezone'];
$headers[] = $this->ewsHeaders['timezone'];
}

$response = parent::__call($name, $args);
$this->__default_headers = [];
return $response;
$headers = array_filter($headers, function ($header) {
if (!($header instanceof SoapHeader)) {
return false;
}

return true;
});

$this->__setSoapHeaders($headers);
return parent::__call($name, $args);
}

/**
Expand Down