# \[F\] $validate() bug?

**URL:** https://community.mp3tag.de/t/f-validate-bug/9743
**Category:** Fixed Bugs
**Tags:** bug-fixed
**Created:** [January 21, 2010, 3:16pm UTC](https://community.mp3tag.de/t/f-validate-bug/9743 "2010-01-21T15:16:47Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![blackspawn](https://community.mp3tag.de/user_avatar/community.mp3tag.de/blackspawn/32/86_2.png) [@blackspawn](https://community.mp3tag.de/u/blackspawn)
#### Post date: [January 21, 2010, 3:16pm UTC](https://community.mp3tag.de/t/f-validate-bug/9743/1 "2010-01-21T15:16:47Z")

</div>

I'm using version 2.45a in Vista SP2, and the $validate() function is only validating the filename, not the full path. A short example:

$validate(%album%\%artist%, '_') only evaluates %artist% for invalid characters, if there are any present in %album% they just get removed.  
However, $validate(%album% %artist%, '_') validates everyting (album and artist)

The help file cleary states: Remove invalid characters from file name/file paths so this should work for file paths too and not only for the filename right?

I was using this with 2.44 and it worked ok, should I be using another syntax for validating the path AND filename?

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [January 21, 2010, 7:40pm UTC](https://community.mp3tag.de/t/f-validate-bug/9743/2 "2010-01-21T19:40:13Z")

</div>

If I have **ARTIST=Test?** and **ALBUM=Test?** and use $validate(%album%\%artist%,_)_ I get **Album\Artist\_** as result.

Can you please post detailed information about the content of the tag fields and the result you're observing.

Thanks!

Florian

---

<div class="post-metadata">

### Author: ![blackspawn](https://community.mp3tag.de/user_avatar/community.mp3tag.de/blackspawn/32/86_2.png) [@blackspawn](https://community.mp3tag.de/u/blackspawn)
#### Post date: [January 22, 2010, 5:20pm UTC](https://community.mp3tag.de/t/f-validate-bug/9743/3 "2010-01-22T17:20:16Z")

</div>

Hi Florian, thx for the quick reply. Here is the info you requested:

**Tag-Filename code**

$validate($if($eql(%genre%,'Soundtrack'),'_Soundtracks['%year%']' %album%,%artist%'['%year%']' %album%)$ifgreater($right(%discnumber%,1),1,CD$left(%discnumber%,1),)$num(%track%,2). %title%,'_')

**Test case**

Artis: "Iced Earth"  
Album: "The Crucible of Man: Something Wicked Part 2"  
Title: "Sacred Flames"  
Year: "2008"  
Track: "1"  
Disc: "1/1"  
Tag: "Flac"

**Result**

Iced Earth[2008] The Crucible of Man Something Wicked Part 2\01. Sacred Flames.flac

.... also a simple $validate(%album%\%title%, '_') has the same result regarding the validation of the album string, however if I use $validate(%album% %title%, '_') the %album% part is correctly evaluated.

---

<div class="post-metadata">

### Author: ![blackspawn](https://community.mp3tag.de/user_avatar/community.mp3tag.de/blackspawn/32/86_2.png) [@blackspawn](https://community.mp3tag.de/u/blackspawn)
#### Post date: [February 21, 2010, 3:24pm UTC](https://community.mp3tag.de/t/f-validate-bug/9743/4 "2010-02-21T15:24:02Z")

</div>

Hi Florian,

I don't mean to bother you but have you any news or been able to verify this on your end?

Thanks!

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [February 21, 2010, 7:18pm UTC](https://community.mp3tag.de/t/f-validate-bug/9743/5 "2010-02-21T19:18:13Z")

</div>

Yes, it happens for colons only and will fixed with the next version. Thanks for reminding me 🙂

Kind regards,  
Florian

---

<div class="post-metadata">

### Author: ![blackspawn](https://community.mp3tag.de/user_avatar/community.mp3tag.de/blackspawn/32/86_2.png) [@blackspawn](https://community.mp3tag.de/u/blackspawn)
#### Post date: [February 21, 2010, 9:41pm UTC](https://community.mp3tag.de/t/f-validate-bug/9743/6 "2010-02-21T21:41:07Z")

</div>

Your just awesome! 🙂 Thanks!

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [February 27, 2010, 1:12pm UTC](https://community.mp3tag.de/t/f-validate-bug/9743/7 "2010-02-27T13:12:45Z")

</div>

This is now fixed with [Mp3tag v2.45c](http://developer.mp3tag.de).

---

<div class="post-metadata">

### Author: ![Florian](https://community.mp3tag.de/user_avatar/community.mp3tag.de/florian/32/5759_2.png) [@Florian](https://community.mp3tag.de/u/Florian)
#### Post date: [December 28, 2018, 2:04pm UTC](https://community.mp3tag.de/t/f-validate-bug/9743/8 "2018-12-28T14:04:30Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
