Skip to content

Commit a9a3dee

Browse files
authored
Merge pull request #83 from stof/patch-1
Fix the BC layer for the legacy execute method
2 parents d0c9aa5 + 039c9d3 commit a9a3dee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/WebDriver/Session.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,16 +455,16 @@ public function alert()
455455

456456
/**
457457
* script execution method chaining, e.g.,
458-
* - $session->execute() - fallback for legacy JSON Wire Protocol
458+
* - $session->execute($jsonScript) - fallback for legacy JSON Wire Protocol
459459
* - $session->execute()->method() - chaining
460460
*
461461
* @return mixed
462462
*/
463463
public function execute()
464464
{
465465
// execute script
466-
if (func_num_args() === 0) {
467-
$result = $this->curl('POST', '/execute');
466+
if (func_num_args() > 0) {
467+
$result = $this->curl('POST', '/execute', func_get_arg(1));
468468

469469
return $result['value'];
470470
}

0 commit comments

Comments
 (0)