From: Filipus K. <ch...@gm...> - 2011-12-30 06:58:37
|
Hi Marc, Le 2011-12-29 18:05, Marc Laporte a écrit : > Hi! > > Could the system detect Tiki8 vs Tiki9? because I doubt we'll be able to > sync the releases perfectly. Since there is no profile-specific protocol, it's not easy to change the protocol to version the format. It's probably possible to detect a pre-9 Tiki version in some ways, but I don't know them and this may not be robust. > Maybe where we set profile server, it should say the Tiki version (or > something?) You make me realize that the protocol spoke by profile servers will change with Tiki 9, and pre-Tiki 9 installs acting as profile clients won't know about that. The encoding given by the server won't be the one expected by clients, and I'm not sure what effects this will have. A workaround would be to make Tiki 9 encode its content to simulate the previous situation. If this has to be done, the question about Tiki 9 as a profile client becomes moot, things will work fine with r39346. Otherwise, I think your suggestion could work. To clarify, prior to Tiki 9 the profiles protocol effectively spoken by clients and servers has an issue. This issue disappears with Tiki 9, effectively changing the protocol spoken by both clients and servers, opening 2 possible incompatibilities: Tiki 9 or above client with a pre-Tiki 9 server Pre-Tiki 9 client with a Tiki 9 or above server The former case is not perfect, but shouldn't cause much issues with r39346. The last case could be a problem. > Thanks! > > M :-) > On 2011-12-29 2:47 PM,<ch...@us...> wrote: > >> Revision: 39346 >> http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39346&view=rev >> Author: chealer >> Date: 2011-12-29 19:47:25 +0000 (Thu, 29 Dec 2011) >> Log Message: >> ----------- >> Profiles: Fix HTML-encoded page content when applying a profile from a >> Tiki 8 or below profile server. >> Note: For Tiki 9 and above profile servers, this actually causes a >> regression (content will be incorrectly HTML-decoded). This can be removed >> in the future. >> Ref: r39206 >> >> Revision Links: >> -------------- >> http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39206&view=rev >> >> Modified Paths: >> -------------- >> trunk/lib/profilelib/profilelib.php >> >> Modified: trunk/lib/profilelib/profilelib.php >> =================================================================== >> --- trunk/lib/profilelib/profilelib.php 2011-12-29 08:45:23 UTC (rev 39345) >> +++ trunk/lib/profilelib/profilelib.php 2011-12-29 19:47:25 UTC (rev 39346) >> @@ -336,10 +336,16 @@ >> $content = str_replace("\r", '', $content); >> $begin = strpos($content, "\n\n"); >> >> - if ( $begin !== false ) >> - return substr($content, $begin + 2); >> - else >> + if ( $begin !== false ) { >> + $content = substr($content, $begin + 2); >> + >> + // This allows compatibility with Tiki 8 and >> below, which export page content HTML-escaped. This should not be done for >> Tiki 9 and above and should be removed once only these are supported (after >> Tiki 6 reaches EOL). >> + $content = htmlspecialchars_decode($content); >> + >> + return $content; >> + } else { >> return null; >> + } >> } // }}} >> >> public function getPageParsed( $pageName ) // {{{ >> |