Skip to content

Commit

Permalink
Merge pull request #151 from jhedstrom/150-illegal-string-offset
Browse files Browse the repository at this point in the history
Fix illegal string offset warning.

Signed-off-by: Jonathan Hedstrom <[email protected]>
  • Loading branch information
jhedstrom committed Nov 28, 2017
1 parent 7d58e1a commit aa1f32b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Drupal/Driver/DrushDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,12 @@ public function bootstrap() {
protected function isLegacyDrush() {
try {
// Try for a drush 9 version.
$version = unserialize($this->drush('version', [], ['format' => 'php']));
return version_compare($version['drush-version'], '9', '<=');
$version = trim($this->drush('version', [], ['format' => 'string']));
return version_compare($version, '9', '<=');
}
catch (\RuntimeException $e) {
// The version of drush is old enough that only `--version` was available,
// so this is a legacy version.
return TRUE;
}
}
Expand Down

0 comments on commit aa1f32b

Please sign in to comment.