Page 1 of 1

Update for serendipity_event_flattr wanted

Posted: Sun Jun 05, 2011 1:51 pm
by LazyBadger
Garvin, please, spent some time in order to update Flattr-plugin to latest JS API v. 0.6. On vague rumors, the previous versions or no longer supported already or will be not supported soon

Re: Update for serendipity_event_flattr wanted

Posted: Sun Jun 05, 2011 10:10 pm
by garvinhicking
Hi!

I am quite sure that the current implementation of flattr will not go away so quickly.

I do not do a lot with flattr, I do not have time to spend on this. I will happily commit other people's contributions though! But in the next few weeks and months, I will most probably not be able to put any time into this - sadly I gotta pick my battles due to limited time :)

Regards,
Garvin

Re: Update for serendipity_event_flattr wanted

Posted: Tue Jun 07, 2011 12:37 pm
by LazyBadger
I'll can to do some fixes in backend_display, but not adding data into head - for this task I'll happy to see anybody help

At least one quick-fix is needed now - according to Flattr flattr_dsc must not contain any HTML, but strip_tags() skips at least nbsp
and we have to use instead of

Code: Select all

$flattr_dsc = strip_tags($flattr_dsc);
expanded version

Code: Select all

$flattr_dsc = str_replace(' ',' ',strip_tags($flattr_dsc));
Diff is

Code: Select all

--- E:/serendipity_event_flattr.php	Пн янв 10 10:40:34 2011
+++ Z:/serendipity_event_flattr.php	Вт июн  7 16:27:56 2011
@@ -287,7 +287,7 @@
                 if (empty($flattr_dsc)) {
                     $flattr_dsc = $this->_addslashes($eventData['body']);
                 }
-                $flattr_dsc = strip_tags($flattr_dsc);
+                $flattr_dsc = str_replace(' ',' ',strip_tags($flattr_dsc));
                 
                 if (empty($flattr_cat)) {
                     $flattr_cat = $this->get_config('flattr_cat');

Re: Update for serendipity_event_flattr wanted

Posted: Tue Jun 07, 2011 1:56 pm
by garvinhicking
Hi!

  is not "HTML" it is a entity...even if replacing that single one helps for that instance, other umlauts and special characters would still not work. Removing HTML entities would result in entry bodies with invalid spelling, so IMHO this is an issue where flattr needs to make changes so that HTML entities are allowed. Stripping tags is not a problem of course.

Regards,
Garvin

Re: Update for serendipity_event_flattr wanted

Posted: Tue Jun 07, 2011 2:09 pm
by LazyBadger
  is not "HTML" it is a entity
Yes, I know, and I'm sure you understood, what I wanted to say
Removing HTML entities would result in entry bodies with invalid spelling, so IMHO this is an issue where flattr needs to make changes so that HTML entities are allowed.
Probably, but maybe they means not so restrictive rules, because (small quote from site, bolded by me)
title and description will be used to describe your thing on Flattr.com so choose them wisely
...Neither of them support HTML, with the exception of the BR character which, in the case of descriptions, will be converted into newlines before the HTML is removed.
Last sentence can be read as "We remove all HTML (pure HTML-tags) before publishing" and in this case suggested removing nbsp on client-side may be overkill