UnixSystem::open_flashplayer_with tweak

2 views
Skip to first unread message

mosesoak

unread,
Jul 18, 2011, 7:56:47 PM7/18/11
to ProjectSprouts
Luke, I was having some weirdness on my laptop where the Flash Player
would start but wouldn't load the file. I ran around in circles for a
while with the 'OpenFlashPlayerForDumbassOSX' applescript but finally
figured out that it wasn't liking the file input. I fixed it by
putting quotes around it like so,

Open4.popen4("#{exe} '#{swf}'")

That might be hard to read in an email, it's single-quotes around
'#{swf}'.

Not sure if that works universally enuff to add, but it definitely
makes Sprouts usable on this box!

Cheers,
Moses

Alan Pinstein

unread,
Jul 18, 2011, 8:22:57 PM7/18/11
to project...@googlegroups.com
That's actually not the right way to fix it, though it does work on *more* strings than without.

I am not sure of the canonical escape function in ruby, but you'd need something like php's escapeshellarg().

Otherwise your code will break if there are legitimate ' characters in the player name. Though I would imagine that a space char in a flash player path is a few orders of magnitude more likely than a ' thus your solution should push the bug down to a tiny fraction of what it was before since before it would break for anyone that had a space in their hard drive name.

Alan

> --
> You received this message because you are subscribed to the Google Groups "ProjectSprouts" group.
> To post to this group, send email to project...@googlegroups.com
> To unsubscribe from this group, send email to projectsprout...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/projectsprouts?hl=en
>
> For other info you can visit our project at: http://projectsprouts.org, or on Github at: http://github.com/lukebayes/project-sprouts

Luke Bayes

unread,
Jul 19, 2011, 1:00:36 PM7/19/11
to project...@googlegroups.com
Hey Moses,

These paths should be "cleaned" by the System class, or the FileParam class.

I'll take a look and see what I can find.


Thanks,

Luke

mosesoak

unread,
Jul 20, 2011, 2:15:15 PM7/20/11
to ProjectSprouts
Thanks Luke!

On Jul 19, 10:00 am, Luke Bayes <lba...@google.com> wrote:
> Hey Moses,
>
> These paths should be "cleaned" by the System class, or the FileParam class.
>
> I'll take a look and see what I can find.
>
> Thanks,
>
> Luke
>
>
>
> On Mon, Jul 18, 2011 at 4:56 PM, mosesoak <moses...@gmail.com> wrote:
> > Luke, I was having some weirdness on my laptop where the Flash Player
> > would start but wouldn't load the file. I ran around in circles for a
> > while with the 'OpenFlashPlayerForDumbassOSX' applescript but finally
> > figured out that it wasn't liking the file input. I fixed it by
> > putting quotes around it like so,
>
> > Open4.popen4("#{exe} '#{swf}'")
>
> > That might be hard to read in an email, it's single-quotes around
> > '#{swf}'.
>
> > Not sure if that works universally enuff to add, but it definitely
> > makes Sprouts usable on this box!
>
> > Cheers,
> > Moses
>
> > --
> > You received this message because you are subscribed to the Google Groups "ProjectSprouts" group.
> > To post to this group, send email to project...@googlegroups.com
> > To unsubscribe from this group, send email to projectsprout...@googlegroups.com
> > For more options, visit this group athttp://groups.google.com/group/projectsprouts?hl=en
Reply all
Reply to author
Forward
0 new messages