Running Drupal 5.3 with Clean URLs.

1. I upload (attach) a file that includes an ampersand ("&") in the filename.
2. The file is saved to disk with the ampersand preserved correctly.
3. The table view that displays a link to the file replaces the ampersand with "&amp" (without quotes).
4. Because the syntax of the link in incorrect, I get a "Page not Found"

Question: How do I preserve the correct filename and path in the table view?

Any suggestions are appreciated.

Mikep

Comments

mooffie’s picture

The ampersand is actually supposed to be be escaped. But then you didn't paste the HTML so I can't say for sure. I suggest you file an issue.

mikepetersonwi’s picture

Mooffie,

I'm not sure what HTML you're asking about but here a few pieces:

1. HTML of the link in the Table View is <a href="http://www.mysitename.com/files/one &amp;amp; two.pdf">Open</a>
2. HTML of the attachment when viewing the node is:

<td><div class="form-item">
 <input type="text" maxlength="256" name="files[155][description]" id="edit-files-155-description"  size="60" value="One &amp; two.pdf" class="form-text" />
 <div class="description"><small>http://www.insurancecheatsheets.com/files/Rev &amp; Ride Program Rules_0.pdf</small></div>

</div>
</td>

Do either one of these help?

Mikep

mooffie’s picture

<a href="http://www.mysitename.com/files/one &amp;amp; two.pdf">Open</a>

That's a bug. The ampersand is escaped *twice*. I had a look at 'views_upload.inc' and, indeed, it has:

l($link_text, check_url(file_create_url($data->files_filepath)))

The check_url() is redundant --most probably.

You should open an issue against Views. But search first, perhaps it's a known bug.

mooffie’s picture

mikepetersonwi’s picture

I was intending to get back to this.

Thanks again,

Mikep