handle single quote in getRegionObj()

This commit is contained in:
Jeffrey Guo 2014-05-07 16:42:30 +12:00
parent 10da00c796
commit 15d1f56e06

View File

@ -137,7 +137,9 @@ class SilverStripeContext extends MinkContext implements SilverStripeAwareContex
*/
public function getRegionObj($region) {
// Try to find regions directly by CSS selector
$regionObj = $this->getSession()->getPage()->find('css', $region);
//handle data-title with single quote
$locator = str_replace("'", "\'", $region);
$regionObj = $this->getSession()->getPage()->find('css', $locator);
if($regionObj) {
return $regionObj;
}