[geeklog-devel] Plugin upgrade failure (was: More automation)

Rouslan Placella rouslan at placella.com
Sat May 21 17:10:20 EDT 2011


On Sat, 2011-05-21 at 22:19 +0200, Dirk Haun wrote:
> Rouslan Placella wrote:
> 
> > I didn't try your fix yet, but from what I can see in plugins.php, there
> > is no output sent to the browser when you call COM_refresh($url). So it
> > should be possible to use:
> > 
> > header("Location: $url");
> > 
> > Will that send a referrer?
> 
> For a moment, I thought I had missed something obvious ... It's not so easy, unfortunately.
> 
> The referrer is just another HTTP header. But we can't create it, the browser has to do it:
> 
> COM_refresh() creates an HTML snippet that does a meta refresh to the new URL. This HTML snippet is sent to the browser as the result of clicking the "Upload" button. The browser then sends another HTTP GET request (to the URL from the meta refresh) back to Geeklog (which then triggers the second part of the plugin upgrade). The referrer would have to be sent with that GET request, i.e. the browser would have to create it.
> 
> The only way we could make this work would be by throwing some JavaScript into the mix. But I don't really want the plugin upload to _require_ JavaScript. That's the tradeoff here, I guess.
> 
> bye, Dirk

Perhaps I'm missing something, but the 'header("Location: $url");' call
does send a referer. It's the referer that it itself received, it merely
copies it over. And since we go from plugins.php to plugins.php and once
more to plugins.php, I'm guessing it could be good enough. Try the
example in the attached tarball by clicking the link on page1.php

Could this work or am I just embarrassing myself further on the list?

Rouslan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: referer_test.tar.gz
Type: application/x-compressed-tar
Size: 307 bytes
Desc: not available
URL: <https://pairlist8.pair.net/pipermail/geeklog-devel/attachments/20110521/9c199f91/attachment.bin>


More information about the geeklog-devel mailing list