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.
  • Loading branch information
jhedstrom authored Nov 28, 2017
2 parents f900a3a + 55d1ac7 commit 4d11b5d
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 4d11b5d

Please sign in to comment.