Re: [SMARTY-DEV] Bug in the fetch plugin

From: Date: Sun, 08 Dec 2002 23:02:21 +0000
Subject: Re: [SMARTY-DEV] Bug in the fetch plugin
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-386@lists.php.net to get a copy of this message
I adjusted the function in CVS, and cleaned the code just a bit using the ternary operator. Basically replace both of these tests with: $uri = !empty($uri_parts['path']) ? $uri_parts['path'] : '/'; $uri .= !empty($uri_parts['query']) ? '?' . $uri_parts['query'] : ''; loic d'Anterroches wrote:
Yop, The fetch plugin erase the query string of an url when you want to grab it. For example: {fetch file="http://sourceforge.net/export/projhtml.php?group_id=44465&mode=full&no_table="} Here the "patch" yes it is not a real patch ;) Add:
               if(!empty($uri_parts['query'])) {
$uri .= "?" . $uri_parts['query']; } else { $uri .= "?" . $uri_parts['query']; } Just after:
               if(!empty($uri_parts['path'])) {
$uri = $uri_parts['path']; } else { $uri = '/'; } And now it works: http://www.xulit.com/ loic


« previous php.smarty.dev (#386) next »