MrBertie / pagequery

An all-in-one, multi-column page listing plugin for Dokuwiki
http://www.dokuwiki.org/plugin:pagequery
16 stars 19 forks source link

pagequery sometimes creates empty link tags #22

Closed mightymt closed 10 years ago

mightymt commented 10 years ago

I noticed on that sometimes pagequery produces empty link tags like the following (which are obviously not displayed in the browser):

<a class="wikilink1" title="namespace:page" href="/dokuwiki/doku.php?id=namespace:page"></a>

This is the pagequery syntax I used:

{{pagequery>@. *;sort=cdate;snippet=inline;hidestart;display={title} — {date:created};hidejump;fontsize=100%;}}

I'm able to consistently reproduce this when the locale is "de_DE" or "de_AT" on both my local machine (Windows with PHP 5.3.5) and on my webhost (Linux with PHP 5.4.23).

I tracked it down to the fact that I used date:created in the "display" option. The problem occurs when the month name contains an Umlaut like Mär (March) or with "de_AT" locale also Jän (January).

After I had finally figured out the source code and did some googling it looks like this can be quite easily fixed by passing the output of strftime on line 633 in pagequery.php through utf8_encode. Works without problems on the systems mentioned above.

MrBertie commented 10 years ago

Great bug report! Thanks much for finding the problem and better still finding a solution. Once I get some free time I will release an update. Symon On 30 Dec 2013 7:09 PM, "mightymt" notifications@github.com wrote:

I noticed on that sometimes pagequery produces empty link tags like the following (which are obviously not displayed in the browser):

<a class="wikilink1" title="namespace:page" href="/dokuwiki/doku.php?id=namespace:page">

This is the pagequery syntax I used:

{{pagequery>@. *;sort=cdate;snippet=inline;hidestart;display={title} — {date:created};hidejump;fontsize=100%;}}

I'm able to consistently reproduce this when the locale is "de_DE" or "de_AT" on both my local machine (Windows with PHP 5.3.5) and on my webhost (Linux with PHP 5.4.23).

I tracked it down to the fact that I used date:created in the "display" option. The problem occurs when the month name contains an Umlaut like Mär (March) or with "de_AT" locale also Jän (January).

After I had finally figured out the source code and did some googling it looks like this can be quite easily fixed by passing the output of strftime on line 633 in pagequery.php through utf8_encode. Works without problems on the systems mentioned above.

— Reply to this email directly or view it on GitHubhttps://github.com/MrBertie/pagequery/issues/22 .

mightymt commented 10 years ago

You're welcome.

While I was at it, I went ahead and changed that myself. Just created a pull request. I think this should work as expected...

MrBertie commented 10 years ago

Tx + + On 30 Dec 2013 7:39 PM, "mightymt" notifications@github.com wrote:

You're welcome.

While I was at it, I went ahead and changed that myself. Just created a pull request. I think this should work as expected...

— Reply to this email directly or view it on GitHubhttps://github.com/MrBertie/pagequery/issues/22#issuecomment-31357509 .