Item14225: EXPORTEDPREFERENCES has not kept up with changes to FOSWIKI.pm
Current State: Confirmed
Released In: 2.2.0
Target Release: minor
The setting for EXPORTEDPREFERENCES in DefaultPreferences
does not match what is actually in the inline script tag.
- ATTACHMENTNAMEFILTER is missing
- URLHOST is missing
- SCRIPTURLPATHS is missing.
This might make it confusing for a plugin that uses EXPORTEDPREFERENCES as the authority for extending the list (as documented).
The %URLHOST% doesn't have equivalent Wiki variable. The documented way to get the hostname is to use the ENV variable HTTP_HOST (foswiki.org) however in a proxy environment, that will most likely be incorrect. URLHOST however is taken from the configuration and would be accurate.
The NAMEFILTER and ATTACHMENTNAMEFILTER are initialized in the
. They should probably be added to Foswiki.pm too. (NAMEFILTER is also initialized in DefaultPreferences
, using a %QUERY macro against the configuration.)
We need a comment in
stating that this module be kept in sync with the EXPORTEDPREFERENCES default setting.
- Add missing settings from DefaultPreferences EXPORTEDPREFERENCES
- Update FOSWIKI.pm to add an exception in processing SCRIPTURLPATHS.
- Add ATTACHMENTNAMEFILTER, NAMEFILTER and URLHOST to Foswiki.pm default macros.
- Remove the initialization from DefaultPreferences.
Conditional initializations in
need to be retained for backwards compatibility.
- 19 Nov 2016
URLHOST and SCRIPTURLPATHS are always there. They don't need to be listed in EXPORTEDPREFERENCES. They are required for the
text="<script class='foswikiPreferences' type='text/json'>
var val = foswiki.getPreference("MyPluginSettings").foo;
should not be used directly. Instead use
foswiki.getScriptUrl(script, web, topic, params)
foswiki.getrScriptUrlPath(script, web, topic, params)
- 22 Nov 2016
Marking this for 2.2, and for now leaving it in the item branch, unmerged.
- 05 Dec 2016