Changeset 1609

Show
Ignore:
Timestamp:
05/29/08 09:06:00 (3 months ago)
Author:
mikey
Message:

throw away empty params
whitespace fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/main/php/net/stubbles/xml/xsl/util/stubXSLRequestParams.php

    r1608 r1609  
    7979        parse_str($queryString, $data); 
    8080        foreach ($data as $key => $value) { 
    81            if ('processor' === $key || 'page' === $key) { 
    82                $return = str_replace($key . '=' . $value, '', $return); 
    83            
     81            if ('processor' === $key || 'page' === $key) { 
     82                $return = str_replace($key . '=' . $value, '', $return); 
     83           
    8484        } 
    8585         
    86         return str_replace('&&', '&', $return); 
     86        return str_replace('&=', '', str_replace('&&', '&', $return)); 
    8787    } 
    8888} 
  • trunk/src/test/php/net/stubbles/xml/xsl/util/stubXSLRequestParamsTestCase.php

    r1608 r1609  
    5757                          ->method('getValidatedValue') 
    5858                          ->with($this->anything(), $this->equalTo('QUERY_STRING'), $this->equalTo(stubRequest::SOURCE_HEADER)) 
    59                           ->will($this->returnValue('processor=xml&page=article&article_id=89&test=foo')); 
     59                          ->will($this->returnValue('processor=xml&page=article&article_id=89&=&test=foo')); 
    6060        $doc =  $this->xslRequestParams->getQueryString(); 
    6161        $this->assertEquals('<?xml version="1.0" encoding="UTF-8"?>' . "\n<requestParams>&amp;article_id=89&amp;test=foo</requestParams>\n", $doc->saveXML());