Development

Changeset 10618

You must first sign up to be able to contribute.

Changeset 10618

Show
Ignore:
Timestamp:
08/02/08 22:14:38 (1 year ago)
Author:
nicolas
Message:

[1.0] fixed sfBrowser::click throw unexpected PHP error when trying to retrieve a value from an empty selectbox (with no option tags)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/lib/util/sfBrowser.class.php

    r9672 r10618  
    413413 
    414414        // if no option is selected and if it is a simple select box, take the first option as the value 
    415         if (!$found && !$multiple) 
    416         { 
    417           $value = $xpath->query('descendant::option', $element)->item(0)->getAttribute('value'); 
     415        $option = $xpath->query('descendant::option', $element)->item(0); 
     416        if (!$found && !$multiple && $option instanceof DOMElement) 
     417        { 
     418          $value = $option->getAttribute('value'); 
    418419        } 
    419420      } 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.