Can someone explain this code?

The place for "I can't figure out how to..." questions.
Post Reply
mr rick
User
Posts: 2
Joined: Tue May 22, 2007 6:20 am
Location: NorCal

Can someone explain this code?

Post by mr rick » Fri May 25, 2007 6:19 am

I want to add a custom album name to an MP3 file. By default demo.write.php using this for the Value:

Code: Select all

<INPUT TYPE="TEXT" SIZE="40" NAME="Artist" VALUE="'.FixTextFields(@implode(', ', @$OldThisFileInfo['comments']['album'])).'">
Can someone explain what the FixTextFields command is doing? If I wanted to add an album name such as my website, mywebsite.com, would it look like this?

Code: Select all

<INPUT TYPE="TEXT" SIZE="40" NAME="Artist" VALUE="mywebsite.com">
And then, would I use this to get it into the WriteTags?

Code: Select all

$TagData['genre'][] = getid3_lib::SafeStripSlashes($_POST['Album']);
I hope all this makes sense!
Using 1.7.7 on PHP 5

Allan Hansen
getID3() v2 developer
Posts: 445
Joined: Sun May 04, 2003 2:22 pm
Location: Holmegaard, Denmark

Post by Allan Hansen » Fri May 25, 2007 6:57 am

function FixTextFields($text) {
return htmlentities(getid3_lib::SafeStripSlashes($text), ENT_QUOTES);
}


Basically it strips any quotes that might have been added by magic quotes and convert special chars to HTML entities.

Post Reply