You are here: Foswiki>Tasks Web>Item12099 (29 May 2014, GeorgeClark)Edit Attach

Item12099: META parser baulks if META badly formed

pencil
Priority: Normal
Current State: Confirmed
Released In: n/a
Target Release: minor
Applies To: Engine
Component: FoswikiMeta
Branches:
Reported By: JulianLevens
Waiting For:
Last Change By: GeorgeClark
Yesterday I noticed that META:TOPICINFO in CommandsAndCGIScripts had extra whitespace introduced, something like:
  • META:TOPICINFO { author = "ProjectContributor" date = "131546565" format = "1.1" version = "1"}

After:
  • my ($meta, $topicText) = Foswiki::Func::readTopic( $w, $t );

When extracting TOPICINFO, I do not get 'keys' of author, date, format etc

I'm offered a key of "131546565" format, which is hardly to spec.

The parser should cope better and/or reject bad keys and/or reject the whole META line (leaving it as part of topic text).

I've had similar issues before.

-- JulianLevens - 26 Sep 2012

I'm particularly concerned by the GroupTemplate that's part of TopicUserMappingContrib the value of the META:PREFERENCE for ALLOWTOPICCHANGE is %URLPARAM{"topic"}% but this is parsed by meta as %URLPARAM{ which suggests that generating new wiki groups, via this contrib, will also be broken.

-- JulianLevens - 04 Dec 2012

That last point is probably caused by the META:PREFERENCE being created by a dev in the topic text. See http://foswiki.org/Sandbox/SetPrefTest where I create something similar. Here the parameter gets encoded, thus bypassing the issue.

The first issue above is also probably caused by the META:TOPICINFO line being created by a dev via a text editor etc. This suggests we need a dev tool during checkin to spot badly formed (unparseable) META

This does not mean that this issue is fixed par se, but save and load via Foswiki itself maybe OK. Better parsing would still be good (see also Item12100)

-- JulianLevens - 26 Mar 2013
 

ItemTemplate edit

Summary META parser baulks if META badly formed
ReportedBy JulianLevens
Codebase trunk
SVN Range
AppliesTo Engine
Component FoswikiMeta
Priority Normal
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease minor
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r4 - 29 May 2014, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy