From 75e43ccc3a43f8328a88b5e95ad6773b0fb30875 Mon Sep 17 00:00:00 2001 From: Alexander Makarov Date: Wed, 12 Oct 2016 00:38:04 +0300 Subject: [PATCH] Fixes regression introduced by #12576. Closes #12576 --- framework/helpers/BaseConsole.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/helpers/BaseConsole.php b/framework/helpers/BaseConsole.php index 6e6f913564..1e0b543a1a 100644 --- a/framework/helpers/BaseConsole.php +++ b/framework/helpers/BaseConsole.php @@ -613,8 +613,8 @@ class BaseConsole if (static::isRunningOnWindows()) { $output = []; exec('mode con', $output); - if (isset($output, $output[1]) && preg_match('/con:.*lines:\s+(\d+)\s+columns:\s+(\d+)/mi', implode(' ', $output), $matches)) { - return $size = [(int)$matches[2], (int)$matches[1]]; + if (isset($output, $output[1]) && strpos($output[1], 'CON') !== false) { + return $size = [(int) preg_replace('~\D~', '', $output[4]), (int) preg_replace('~\D~', '', $output[3])]; } } else { // try stty if available