Skip to content
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# CHANGELOG


## 1.16.1 (Unreleased)

* Pass explicit trim characters ahead of the PHP 8.6 trim default change


## 1.16.0 (2026-07-06)

* Promote the returned `PageUtils` helper classes to the public API
Expand Down
2 changes: 1 addition & 1 deletion src/AutoDiscover.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function guessChromeBinaryPath(): string
case 'Windows':
return self::getFromRegistry() ?? '%ProgramFiles(x86)%\Google\Chrome\Application\chrome.exe';
default:
return \rtrim(\explode("\n", (string) self::shellExec('command -v google-chrome || command -v chromium-browser || command -v chrome || command -v chromium'), 2)[0]) ?: 'chrome';
return \rtrim(\explode("\n", (string) self::shellExec('command -v google-chrome || command -v chromium-browser || command -v chrome || command -v chromium'), 2)[0], " \n\r\t\0\x0B") ?: 'chrome';
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/Browser/BrowserProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -434,15 +434,15 @@ private function waitForStartup(Process $process, int $timeout)

// exception
$message = 'Chrome process stopped before startup completed.';
$error = \trim($process->getErrorOutput());
$error = \trim($process->getErrorOutput(), " \n\r\t\0\x0B");
if (!empty($error)) {
$message .= ' Additional info: '.$error;
}

throw new RuntimeException($message);
}

$output = \trim($process->getIncrementalErrorOutput());
$output = \trim($process->getIncrementalErrorOutput(), " \n\r\t\0\x0B");

if ($output) {
// log
Expand All @@ -451,7 +451,7 @@ private function waitForStartup(Process $process, int $timeout)
$outputs = \explode(\PHP_EOL, $output);

foreach ($outputs as $output) {
$output = \trim($output);
$output = \trim($output, " \n\r\t\0\x0B");

// ignore empty line
if (empty($output)) {
Expand All @@ -470,7 +470,7 @@ private function waitForStartup(Process $process, int $timeout)
throw new RuntimeException('Devtools could not start');
}
// log
$this->logger->debug('process: ignoring output:'.\trim($output));
$this->logger->debug('process: ignoring output:'.\trim($output, " \n\r\t\0\x0B"));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Input/KeyboardKeys.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,6 @@ public function getPressedKeys(): array
*/
protected function setCurrentKey(string $key): void
{
$this->currentKey = \ucfirst(\trim($key));
$this->currentKey = \ucfirst(\trim($key, " \n\r\t\0\x0B"));
}
}