Improper COinS parsing of rft.identifier

Zotero truncates URLs in a COinS rft.identifier field if that URL contains an equals (=) sign.

For instance, if the span title contains "rft.identifier=http://www.zotero.org/?key=val", Zotero will save this as the URL, "http://www.zotero.org/?key". I encountered this after I installed the WordPress plugin (available here: http://dev.zotero.org/docs/wordpress) on my blog. Zotero was truncating the querystring that specified the post ID.

I don't know if this is a problem with the WordPress plugin or Zotero's handling of COinS. I would suspect the latter since it should be possible to represent a URL with an equals sign.

Using version 1.0.0b3.r1.r1165
  • Can you provide a URL that this is happening on (or just paste in the COinS block that the page is outputting)? Thanks.
  • edited February 9, 2007
    Sure,

    Here's the SPAN:

    (see page source)
  • If that HTML doesn't work out, the page in question is at http://snosrap.com/blog/?p=72
  • Looks like a bug in the WordPress plugin—the values should be URL-encoded (e.g. the equals sign in the rft.identifier value should be '%3D', not '=').

    We'll put out a new version that fixes this. In the meantime, it should be trivial to fix yourself with some urlencode() calls in the PHP file. Thanks.
  • Cool, URL-encoding did the trick.

    FYI, I modified the wp-content/plugins/coins-metadata.php file as follows:

    I deleted

    <?php the_permalink(); ?>

    and added

    <?php echo urlencode(get_permalink()); ?>

    Note: I used GET_permalink() instead of THE_permalink(). GET returns the string whereas THE simply echos it.
Sign In or Register to comment.