We've noticed a weird problem today, when one of my users ripped his songs from his CD using iTunes, and uploaded them, they ALL had question marks added at the end of the Artist / Title / etc fields, which caused pathauto to freak out completely.

The pathauto side of the issue is obviously for discussion elsewhere, but the cause of the issue appears to be these iTunes question marks being generated via getID3/audio module??

I should add that the MP3's ID3 tags when viewed directly in Winamp etc do not have visible question marks or any strange characters - only normal letters/words.

Any thoughts on this issue?

Comments

drewish’s picture

Status: Active » Closed (duplicate)

please search for existing issues first. this is a duplicate of: http://drupal.org/node/156476 since there's about 10 other duplicates of it it should be easy to find ;)

mediafrenzy’s picture

Oops! Sorry Drewish, I did search - though it was at 3am ...

Besides that, I didn't really know what to search for - as I didn't know it was a UTF-8 ID3 corruption issue... but point taken.

drewish’s picture

whoops, i apologize, i directed you to the wrong issue. it should have been : http://drupal.org/node/145117

mediafrenzy’s picture

Ah ok - but I see the quick fix that is given there is to use GetID3 1.7.7 .... which is the version I am already using?

mediafrenzy’s picture

Status: Closed (duplicate) » Active

This is still happening, and I believe some others are having the same experience of this, despite using Get ID3 1.7.7 etc.

So just to clarify, the ARTIST and TITLE fields displayed on the audio page have a question mark added to them, which gets automatically added to the Page Title.

In my case at least, this then carries over into the pathauto module, breaking the page URL and causing a 404 to be displayed if the page is viewed. This breaking of the page URL effect wouldn't be the case if not using pathauto obviously.

BrianKlinger’s picture

Subscribing - same issue as mediafrenzy - I am using Drupal 5.7, getID3 1.7.7, latest Dev version of audio node (5.x-1.x-dev), and firefox.

I am getting a %00 character (I'm using pathauto, so %00 is what's showing up in the url), which if I understand correctly, is a NUL character, which is being replaced by the lovely diamond question mark (as described by mediafrenzy).

zirafa’s picture

I also see NUL characters placed in the middle of the tags. This was causing playlist feeds to break. As a workaround, I applied a patch that removed all NUL characters before output:

$output = str_replace("\0",'',$output);

zirafa’s picture

Just to clarify, the patch and related thread is here: http://drupal.org/node/212913

mediafrenzy’s picture

Thanks Zirafa - so we'd need to also upgrade our audio modules to 5.x-2.x-dev in order to apply that patch?

zirafa’s picture

That patch wouldn't fix this issue, just the other issue with playlist feeds breaking.

However, I think a patch could be made that strips the NUL characters before saving the getid3 tags to the database, which might solve this problem too.

mediafrenzy’s picture

Ah right I see.

If any coder reading this has a spare moment, we'd really appreciate someone crafting a patch for this issue :)

zirafa’s picture

Status: Active » Needs review
StatusFileSize
new674 bytes

Here, try this patch. I have not been able to duplicate this problem and test this patch but I suspect it might fix things. It basically strips the NUL characters from the tags before writing the id3 tags to the file/database.

This patch won't fix already uploaded files, but try re-uploading a file and see if it fixes it.

mediafrenzy’s picture

Cool thanks very much zirafa, I'll test that out tomorrow and report back here whether that seems to nail it.

dnewkerk’s picture

Tested the patch on version 5.x-1.3 and it worked fine. The extra ? after each metadata line is no longer present when uploading new audio files. Navigated through all audio pages and didn't experience any errors.

Thanks - hope you can include this now in the next version of the module.

BrianKlinger’s picture

I used the patch and it all works pretty well but I still have one problem. I use pathauto to name the url. My pathauto grabs the title of the node which is based on the id3 metadata, and apparently it grabs the title BEFORE the NUL characters are stripped, so the URL STILL has the NUL characters in it. The metadata and the title are correct when I edit the node (I can't just go to the node because the url is broken due to the NUL characters), so I have to resave the node for the url to grab the new title (I had to change how pathauto behaves in order to fix this problem). This certainly isn't critical and I've found a workaround, but it's still a bit of an inconvenience. If anyone can come up with a better solution, I'd love to test it/try it out.

McCool’s picture

I've reached a similar situation, but I think I've fixed it.

After making the change in the patch above , the meta tags appear OK, no longer any questions remark, but the title and therefore pathauto generated path, still have the problem. Stripping the \0 characters out at the point of reading the tags from the file seems to be the way forward.

So I edited the audio_read_id3tags() function in audio_getid3.module as follows.

I replaced this line (line 330 I think):

$ret['tags'][$key] = array_pop($value);

with this:

$ret['tags'][$key] = array_pop(str_replace("\0", '', $value));

It now seems to work fine for me.

sillygwailo’s picture

StatusFileSize
new752 bytes

Attached is a patch that incorporates both #12 and #16.

daveo’s picture

Thanks very much Richard - this has caused me much extra fiddling when posting podcasts!

BrianKlinger’s picture

Yup - fixes 12 and 16 (combined in 17) fixed my issues, as well! Thanks for the hard work, everyone!

drewish’s picture

Status: Needs review » Fixed

thanks, committed to HEAD and DRUPAL-5.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.