Changeset 269 for trunk/trax/vendor

Show
Ignore:
Timestamp:
10/31/06 18:44:25 (6 years ago)
Author:
john
Message:

minor fix to AC for the browser_url

Location:
trunk/trax/vendor/trax
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/trax/vendor/trax/action_controller.php

    r229 r269  
    415415 
    416416        # current url 
    417         if(isset($_SERVER['REDIRECT_URL'])) { 
     417        if(isset($_SERVER['REDIRECT_URL']) && !stristr($_SERVER['REDIRECT_URL'], 'dispatch.php')) { 
    418418            $browser_url = $_SERVER['REDIRECT_URL']; 
    419         } else { 
    420             $browser_url = $_SERVER['REQUEST_URI'];         
    421         }         
    422         #if(strstr($_SERVER['REQUEST_URI'], "?")) 
    423         #    $browser_url = substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], "?")); 
    424         #else 
    425         #    $browser_url = $_SERVER['REQUEST_URI'];     
    426          
     419        } elseif(isset($_SERVER['REQUEST_URI'])) { 
     420            $browser_url = strstr($_SERVER['REQUEST_URI'], "?") ? 
     421                substr($_SERVER['REQUEST_URI'], 0, strpos($_SERVER['REQUEST_URI'], "?")) : 
     422                $_SERVER['REQUEST_URI']; 
     423        } 
     424 
    427425        //error_log('browser url='.$browser_url); 
    428426        # strip off url prefix, if any 
     
    431429        } 
    432430 
    433         # strip leading slash 
    434         // FIXME: Do we know for sure that the 
    435         // initial '/' will be there? 
    436         $browser_url = substr($browser_url,1); 
     431        # strip leading slash (if any) 
     432        if(substr($browser_url, 0, 1) == "/") { 
     433            $browser_url = substr($browser_url, 1); 
     434        } 
    437435 
    438436        # strip trailing slash (if any) 
  • trunk/trax/vendor/trax/action_view/helpers/form_options_helper.php

    r243 r269  
    121121                    . htmlspecialchars($choice_value) 
    122122                    . "\" selected=\"selected\">" 
    123                     . htmlspecialchars($choice_text)."</option>"; 
     123                    . htmlspecialchars(is_object($choice_text) ? $choice_text->__toString() : $choice_text)."</option>"; 
    124124                } else { 
    125125                    $options[] = "<option value=\"" 
    126126                    . htmlspecialchars($choice_value) 
    127127                    . "\">" 
    128                     . htmlspecialchars($choice_text)."</option>"; 
     128                    . htmlspecialchars(is_object($choice_text) ? $choice_text->__toString() : $choice_text)."</option>"; 
    129129                }                         
    130130            }     
     
    157157            foreach($collection as $object) { 
    158158                if(is_object($object)) { 
    159                     $options[$object->send($attribute_value)] = 
    160                         $object->send($attribute_text);             
     159                    //$options[$object->send($attribute_value)] = $object->send($attribute_text); 
     160                    $options[$object->$attribute_value] = $object->$attribute_text; 
    161161                } 
    162162            }