Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.4.4

Bug #9119 htmlspecialchars() used instead of urlencode()
Submitted: 2006-10-21 00:54 UTC Modified: 2006-11-03 12:15 UTC
From: cellog Assigned: shin
Status: Closed Package: Testing_Selenium (version 0.2.0)
PHP Version: 5.1.6 OS: n/a
Roadmaps: (Not assigned)    
Subscription  


 [2006-10-21 00:54 UTC] cellog (Greg Beaver)
Description: ------------ htmlspecialchars() does not properly escape URL key tokens like #, " " or % and you should use urlencode() instead. Index: Selenium.php =================================================================== RCS file: /repository/pear/Testing_Selenium/Selenium.php,v retrieving revision 1.5 diff -u -r1.5 Selenium.php --- Selenium.php 14 Oct 2006 17:44:33 -0000 1.5 +++ Selenium.php 21 Oct 2006 05:50:25 -0000 @@ -1184,7 +1184,7 @@ $url = sprintf('http://%s:%s/selenium-server/driver/?cmd=%s', $this->host, $this->port, htmlspecialchars($verb)); for ($i = 0; $i < count($args); $i++) { $argNum = strval($i + 1); - $url .= sprintf('&%s=%s', $argNum, htmlspecialchars($args[$i])); + $url .= sprintf('&%s=%s', $argNum, urlencode($args[$i])); } if (isset($this->sessionId)) { Test script: --------------- <?php require_once 'Testing/Selenium.php;' $selenium = new Testing_Selenium('*firefox', 'http://pear.php.net/index.php'); $selenium->start(); $selenium->open('http://pear.php.net/index.php'); echo $selenium->getText('table#head'); Expected result: ---------------- works Actual result: -------------- selenium server strips the #head class selector

Comments

 [2006-10-21 05:48 UTC] shin (Shin Ohno)
Thank you for the bug report. This bug will be fixed in next release, 0.2.1.
 [2006-11-01 22:32 UTC] shin (Shin Ohno)
Currently Selenium RC server does not support CSS locator. I think they will support it soon. But, the urlencode problem you pointed out will be fixed, and I will release it very soon. Thank you.
 [2006-11-03 12:15 UTC] shin (Shin Ohno)
Thank you for your bug report. This issue has been fixed in the latest released version of the package, which you can download at http://pear.php.net/get/Testing_Selenium I fixed this bug in 0.2.1.