[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4326: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3501)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4328: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3501)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4329: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3501)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4330: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3501)
UMSP Plugin Development
Sign up here and you can log into the forum!

UMSP Plugin Development

Discussion, features, plugins--everything about zoster's UMSP UPnP Media Server software

Re: UMSP Plugin Development   

Postby mad_ady » Sun Apr 21, 2013 9:20 pm

User avatar
mad_ady
Developer
 
Posts: 4573
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin Development   

Postby DJArty » Sun Apr 21, 2013 10:10 pm

Ok, I hope this don't make problem around crossfirmware work of plugins.
(As I remember on 1.02.21 umsp-test.php warning Conversely required from developer to make conversation from & to & ...)
So if make clear "&" in plugin - it was normally work on 1.02 and on 1.05? (or I need hunt for version number > 0.5.2.x?)
Last edited by DJArty on Sun Apr 21, 2013 10:44 pm, edited 1 time in total.
WD TV Live (1.05.04-WDLXTV-0.5.1.1);
Please Donate PayPal to email: djartyua ( a t ) gmail (d o t) com
WebMoney: WMZ114867333413
User avatar
DJArty
Developer
 
Posts: 551
Joined: Wed Jul 21, 2010 2:30 am
Location: Ukraine

Re: UMSP Plugin Development   

Postby mad_ady » Sun Apr 21, 2013 10:31 pm

The recommended way to do it so that it works on older versions as well is to keep the escaping (if you already have it), but add the double unescape code above. Please note that you will have to do double unescape also in proxy calls, otherwise the URLs will be passed as "&page=5" and will be decoded as &page=5 instead of "&page=5".

So, it's safest to unescape rather than remove url_encode.

The only drawback is that if you escape the title it will be displayed escaped on the WDTV's screen (e.g. "Sports & leisure"), but generally plugins didn't escape titles, just URLs/IDs.
User avatar
mad_ady
Developer
 
Posts: 4573
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin Development   

Postby DJArty » Mon Apr 22, 2013 1:18 am

WD TV Live (1.05.04-WDLXTV-0.5.1.1);
Please Donate PayPal to email: djartyua ( a t ) gmail (d o t) com
WebMoney: WMZ114867333413
User avatar
DJArty
Developer
 
Posts: 551
Joined: Wed Jul 21, 2010 2:30 am
Location: Ukraine

Re: UMSP Plugin Development   

Postby mad_ady » Mon Apr 22, 2013 2:02 am

The example in the wiki is outdated unfortunately :( After you play with it let me know and we'll fix the documentation.

The way development happened on this feature was mostly by trial and failure. At one point I had the UMSP_LAN feature working, but I had to manually run the htmlspecialchars() function and escape everything. This worked, but I also had to escape & inside titles and the WDTV UI wouldn't unescape it (it works just fine with malformed XML), so I got tired and implemented the escaping/unescaping inside the UMSP code.

Now you can send unescaped strings and the following happens (NOTE: this is based on my poor memory - I haven't looked at the code lately, I might have changed the behavior!):
1. If the requester is from 127.0.0.1 (e.g. the internal WDTV DLNA process), then don't do any escaping. The renderer can work with unescaped links, except for IDs. IDs need to be escaped manually.
2. If the requester is from anywhere else, try to send back escaped content for all fields. Escape the field only if needed (if it's already escaped, don't double escape it).

I don't remember why I used htmlspecialchars instead of htmlentities, but if I remember correctly, the only "invalid" characters in XML files are &, > and <, so there was no point in encoding the other characters as well...

Update: After looking through the code, scratching my head and asking a few WTF? it seems it doesn't work like that. I do escape the complete query independent of the requester and I don't use htmlentities or htmlspecialchars, but my own replacement function (_xmlentities). I fail to remember why htmlspecialchars didn't work for me...

The relevant code is in /usr/share/umsp/funcs-upnp.php
User avatar
mad_ady
Developer
 
Posts: 4573
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin Development   

Postby DJArty » Mon Apr 22, 2013 7:11 am

WD TV Live (1.05.04-WDLXTV-0.5.1.1);
Please Donate PayPal to email: djartyua ( a t ) gmail (d o t) com
WebMoney: WMZ114867333413
User avatar
DJArty
Developer
 
Posts: 551
Joined: Wed Jul 21, 2010 2:30 am
Location: Ukraine

Re: UMSP Plugin Development   

Postby mad_ady » Mon Apr 22, 2013 9:55 pm

User avatar
mad_ady
Developer
 
Posts: 4573
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin Development   

Postby DJArty » Tue Apr 23, 2013 1:12 am

One more little thing...
Don't know is it UMSP related or global 1.05 future: if just press and hold arrow down in some listing its step by step only 7 lines and after that jump like page down. Is it posible to turn off this "future"? If I need page down i just press "page down", if I need line by line move I just press "down button" (like in 1.02) what for this speedup?
WD TV Live (1.05.04-WDLXTV-0.5.1.1);
Please Donate PayPal to email: djartyua ( a t ) gmail (d o t) com
WebMoney: WMZ114867333413
User avatar
DJArty
Developer
 
Posts: 551
Joined: Wed Jul 21, 2010 2:30 am
Location: Ukraine

Re: UMSP Plugin Development   

Postby mad_ady » Tue Apr 23, 2013 4:16 am

It isn't UMSP related - it's just the way the OSD works. I doubt you can turn it off...
User avatar
mad_ady
Developer
 
Posts: 4573
Joined: Fri Nov 05, 2010 9:08 am
Location: Bucharest, Romania

Re: UMSP Plugin Development   

Postby DJArty » Sat May 04, 2013 10:10 am

Ok. What I figure out.
I edit my plugins for UMSP 2.0 ready (only 127.0.0.1 fix) and use my "patch" for funcs-upnp.php..
Plugins working good on 1.05.04 -0.5.x.x svn Live and working good on Live Streaming. So Live used like mediaserver for looking UMSP plugins from LiveStreaming (its really quiet mediaserver :) ).
But looks like Live media server don't work normally on software UPnP mediaplayers e.g. from android "UPnP Player" etc.. May by you (mad_ady) use _xmlentities trick for using on software players? Anyway as I say before _xmlentities no need for Streaming work - strange ).
WD TV Live (1.05.04-WDLXTV-0.5.1.1);
Please Donate PayPal to email: djartyua ( a t ) gmail (d o t) com
WebMoney: WMZ114867333413
User avatar
DJArty
Developer
 
Posts: 551
Joined: Wed Jul 21, 2010 2:30 am
Location: Ukraine

PreviousNext

Return to UMSP Media Server

Who is online

Users browsing this forum: No registered users and 3 guests

cron