| View previous topic :: View next topic |
| Author |
Message |
Murrawhip
Joined: 21 Dec 2010 Posts: 58
|
Posted: Thu Dec 08, 2011 5:59 am Post subject: Metadata Warning |
|
|
Hi,
I update my metadata on Icecast manually through a PHP script.
Lately on one of my stations I've been receiving this:
[2011-12-07 21:57:02] INFO admin/command_metadata Metadata song on /CKBX set to "Jason Blaine - Flirtin' With Me"
[2011-12-07 21:57:02] WARN Invalid expression
[2011-12-07 21:57:02] WARN runtime error
[2011-12-07 21:57:02] WARN Evaluating user parameter song failed
Should I be escaping that apostrophe maybe? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Dec 08, 2011 6:21 pm Post subject: |
|
|
I suspect so. Those particular warning messages are coming from libxml2/libxslt.
karl. |
|
| Back to top |
|
 |
Murrawhip
Joined: 21 Dec 2010 Posts: 58
|
Posted: Fri Dec 09, 2011 2:10 pm Post subject: |
|
|
So now I'm confused.
I'm using a script that a lot of people seem to use for updating metadata with PHP.
It encodes with rawurlencode, though I've seen a couple people use urlencode instead.
| Code: |
$songinfo = $artist . " - " . $title;
$currentsonguri = rawurlencode($songinfo);
fwrite($icesocket,"GET /admin/metadata.xsl?song=".$currentsonguri."&mount=/" . $row1[2] . "&mode=updinfo HTTP/1.0\n");
etc.
|
The error only occurs when there's an apostrophe in $songinfo. Both urlencode and rawurlencode change apostrophes into %27. Any clue on what I should be doing differently? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Dec 09, 2011 7:38 pm Post subject: |
|
|
I think it's the xsl translation that is throwing that up, drop the .xsl from the request unless you are really parsing the response
karl. |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Fri Dec 09, 2011 8:00 pm Post subject: |
|
|
confirmed, internally the args are passed for xsl translation but xslt is using the quotes in a reserved manner. The metadata update should be occurring, it's just that the xsl response is cut short because of the way parameters are applied to the xsl when a ' is in there. I have a fix for that ready to go in the update.
karl. |
|
| Back to top |
|
 |
|