On Mar 4, 2010, at 1:56 PM, Sergiu Dumitriu wrote:
On 03/04/2010 10:54 AM, Thomas Mortagne wrote:
On Wed, Mar 3, 2010 at 13:48, sdumitriu
<platform-notifications(a)xwiki.org> wrote:
Author: sdumitriu
Date: 2010-03-03 13:48:22 +0100 (Wed, 03 Mar 2010)
New Revision: 27429
Modified:
platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/Utils.java
Log:
XWIKI-4955: Page with empty content leads to "This template does not exist"
message when viewed in plain mode
Revert the trim() removal, which makes all the validation tests fail
Then the wrong template should be fixed instead of putting a hack...
It is not a hack, and there is not one wrong template. All the templates
generate whitespaces. I still believe that there is absolutely no reason
not to use the trim(), since nobody cares if the whitespace reaches the
client or not. If you don't agree, feel free to hunt all the whitespace
in the templates, including those in custom skins that duplicate the
templates.
I agree that it's a good idea to protect against overridden templates in custom
skins.
-Vincent
>> Modified:
platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/Utils.java
>> ===================================================================
>> --- platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/Utils.java
2010-03-03 12:44:52 UTC (rev 27428)
>> +++ platform/core/trunk/xwiki-core/src/main/java/com/xpn/xwiki/web/Utils.java
2010-03-03 12:48:22 UTC (rev 27429)
>> @@ -155,7 +155,7 @@
>> // Replace all placeholders with the protected values
>> content = replacePlaceholders(content, context);
>> disablePlaceholders(context);
>> - content = context.getWiki().getPluginManager().endParsing(content,
context);
>> + content =
context.getWiki().getPluginManager().endParsing(content.trim(), context);
>> } catch (IOException e) {
>> if (LOG.isDebugEnabled()) {
>> LOG.debug("IOException while evaluating template [" +
template + "] from /templates/", e);
>>