Re: (no subject)

Ryu <[email protected]> Wed, 02 Nov 2011 21:46 +0100
Newsgroups gmane.comp.horde.ansel
Message-ID <12600476.2rmmRMODKJ@ryu>
Le mercredi 2 novembre 2011 12:38:56 Michael J Rubinsky a écrit :
> 
> This is *exactly* the case I put the recent browser check in Ansel for.
> 
> If you use the new uploader, and view the source from within firefox
> 3.6, you should see a block of code similar to this towards the top of
> the file:
> 
> var uploader = new Horde_Uploader({
>              'target': "/horde/ansel/img/upload.php?gallery=3526",
>              drop_target: "filelist",
>              swf_path: '/horde/js/plupload/plupload.flash.swf',
>              xap_path: '/horde/js/plupload/plupload.silverlight.xap',
>              container: 'anseluploader',
>              text: { start: 'Upload',
>                      add: 'Add Images',
>                      header: 'Upload to gallery',
>                      returnButton: 'View Gallery',
>                      subheader: 'Add files to the upload queue and
> click the start button.',
>                      size: 'File size error.',
>                      type: 'File type error.'
>              },
>              header_class: 'hordeUploaderHeader',
>              container_class: 'uploaderContainer',
>              return_target: 'xxxxx',
>              multipart: false
>          },
> 
> Can you see what the value of the 'multipart' parameter is? For FF <=
> 4.x it should be "true". If it is not, the browser detection is
> failing for some reason.

This is the source...
var uploader = new Horde_Uploader({
            'target': "/ansel/img/upload.php?gallery=1",
            drop_target: "filelist",
            swf_path: '/js/plupload/plupload.flash.swf',
            xap_path: '/js/plupload/plupload.silverlight.xap',
            container: 'anseluploader',
            text: { start: 'Transférer',
                    add: 'Add Images',
                    header: 'Upload to gallery',
                    returnButton: 'View Gallery',
                    subheader: 'Add files to the upload queue and click the 
start button.',
                    size: 'File size error.',
                    type: 'File type error.'
            },
            header_class: 'hordeUploaderHeader',
            container_class: 'uploaderContainer',
            return_target: 'yyyyy',
            multipart: false
        },

After deep search, I finally found that in 'lib/View/Upload.php', line 87
$GLOBALS['browser']->getBrowser() = mozilla
$GLOBALS['browser']->getMajor() = 5 !!!!!

My UserAgent is "Mozilla/5.0 (X11; U; Linux x86_64; fr; rv:1.9.2.23) 
Gecko/20110927 Fedora/3.6.23-1.fc14 Firefox/3.6.23 (fedora 14 default 
browser)"

I have suspected the detection to mix the Mozilla version and the Firefox 
version... It seems to not be the same.

Horde/Browser.php, line 566 : } elseif (preg_match('|Mozilla/([0-9.]+)|', 
$agent, $version)) {
...
list($this->_majorVersion, $this->_minorVersion) = explode('.', $version[1]);

But Mozilla is always 5 => 
(https://developer.mozilla.org/en/User_Agent_Strings_Reference)

I think than we must separate Firefox from Mozilla to get a "Firefox" browser 
in Horde...

Finally, I changed my UserAgent with Firefox User Agent Switcher and changed 
the version of Mozilla to 4.0. The transfert completed sucessfully !

Ryu

-- 
ansel mailing list - Join the hunt: http://horde.org/bounties/#ansel
Frequently Asked Questions: http://horde.org/faq/
To unsubscribe, mail: [email protected]
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)

iEYEABECAAYFAk6xrAoACgkQOt7tMtf83xlYQgCgl94MuGOpdNr0Pyj3HLjEIhHz
o+0An32IrBXLPF0aPbhKB6b+sCG0ZQNj
=rt+3
-----END PGP SIGNATURE-----