• Do not register here on develop.twiki.org, login with your twiki.org account.
• Use View topic Item7848 for generic doc work for TWiki-6.1.1. Use View topic Item7851 for doc work on extensions that are not part of a release. More... Close
• Anything you create or change in standard webs (Main, TWiki, Sandbox etc) will be automatically reverted on every SVN update.
Does this site look broken?. Use the LitterTray web for test cases.

Item4624: Incorrect parsing of parameters with no values in configtopic

Item Form Data

AppliesTo: Component: Priority: CurrentState: WaitingFor: TargetRelease ReleasedIn
Extension PublishContrib Normal Closed   minor  

Edit Form Data

Summary:
Reported By:
Codebase:
Applies To:
Component:
Priority:
Current State:
Waiting For:
Target Release:
Released In:
 

Detail

Plugin version: Rev: 13222 (26 Mar 2007)

Parameters in a config topic which are set to the empty value are incorrectly parsed; the value is taken to be the entirety of the following line. The problem seems that the \s regexp pattern matches newlines (I'm using Perl 5.8.8).

Here's a brief debugging session (at Publish.pm:136) using the provided PublishWeb topic as the config topic. I'm running this as

perl -dT ./publish Public configtopic=Public.PublishWeb

Using the shipped regexp to split out the variables results in this:

  DB<57> while( $cfgt =~ s/^\s+\*\s+Set\s+([A-Z]+)\s*=\s*(.*?)\s*$//m ) { print "$1 = '$2'\n" }
INSTANCE = '* Comma-separated list of [[PublishContrib#WildcardPattern][wildcard patterns]] that match the names of topics to *include*'
INCLUSIONS = '*'
EXCLUSIONS = 'Web*,Publish*'
FILTER = '* Skin for published HTML'
PUBLISHSKIN = 'text'
TEMPLATES = 'view'
FORMAT = 'file'
EXTRAS = '* Name of the publish history topic to us. Default is PublishContribHistory'
HISTORY = '<form method="POST" name="rename" action="%SCRIPTURLPATH%/publish%SCRIPTSUFFIX%/%WEB%">'

Which isn't quite what's expected. Changing the offending \s patterns to [:blank:] (which according to the Perl docs matches "all horizontal whitespace") results in:

  DB<60> while( $cfgt =~ s/^\s+\*\s+Set\s+([A-Z]+)\s*=[[:blank:]]*(.*?)[[:blank:]]*$//m ) {  print "$1 = '$2'\n" }
INSTANCE = ''
INCLUSIONS = '*'
EXCLUSIONS = 'Web*,Publish*'
FILTER = ''
PUBLISHSKIN = 'text'
TEMPLATES = 'view'
FORMAT = 'file'
EXTRAS = ''
HISTORY = ''

-- TWiki:Main/DiabJerius - 13 Sep 2007

Done

CC

ItemTemplate
Summary Incorrect parsing of parameters with no values in configtopic
ReportedBy TWiki:Main.DiabJerius
Codebase 4.1.2
SVN Range TWiki-4.2.0, Sat, 08 Sep 2007, build 14780
AppliesTo Extension
Component PublishContrib
Priority Normal
CurrentState Closed
WaitingFor

Checkins TWikirev:15546
TargetRelease minor
ReleasedIn

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2007-11-10 - CrawfordCurrie
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback