PmWeekly, October 13, 2017
October 13, 2017, at 11:35 AM (14 comments)
Update for PmWiki activity September 27, 2017 - October 13, 2017: 2 new releases, documentation, internationalization, 7 recipes updated, discussions about protecting usernames, calling core functions from config files, cookbook bug reports and patches.
PmWiki version 2.2.103 and 2.2.104 were released
This version is a major upgrade on the internal processing of markups and patterns, all core scripts were updated to be compatible with PHP version 7.2. Whether you use that PHP version or another one, with any local configurations and custom add-ons, there should be no change for what you see, but if any problems please contact us immediately.
Pagelists can now have optimized list=grouphomes
and fmt=#grouphomes
arguments to list only the home pages of your wiki groups, whether they are named Group.HomePage, Group.Group, or a custom Group.$DefaultName
. Minor bugs in older xlpage scripts were fixed, the responsive skin is now compatible with even older PmWiki/PHP versions, web subtitles (*.vtt) were added as an allowed extension, input form fields can now have a "title" attribute (usually rendered as a tooltip/help balloon when the mouse cursor is over the input element), and a configuration variable $AuthLDAPReferrals
was added for wikis running AuthUser over LDAP to force enable or disable referrals when needed.
The documentation was updated.
Marketing
PmWiki entries at Wikipedia ([1], [2], [3]) and WikiMatrix ([4]) were updated.
Focus on... Escaping and commenting out markup
PmWiki uses a few markup rules like additional punctuation to signify when a text needs to become a link, a heading, bold, colored or some other meaning. If you need to escape some text that should not be considered as markup but rendered as-is, you can wrap it in [=...=]
or [@...@]
brackets (the latter renders the text in monospace/fixed width font):
* This is '''bold'''. * This is not [='''bold'''=] * This is not [@'''bold'''@] |
|
If you wish to insert a comment in a page, like a reminder to editors, you can use the (:comment ...:)
directive, eg (:comment Remember to update the Date:)
. This comment will not be printed in the HTML output of the page.
Another way to have a block of text in the page source that will not appear in the HTML output is to use a conditional markup:
(:if false:) This will not be printed in the page. (:ifend:)
You may want to hide a block of text from most visitors but to show it to editors or administrators, in that case use (:if auth edit:)
or (:if auth admin:)
.
Finally, there is a WikiStyle >>comment<<...>><<
or %comment%...%%
that will process and output the text in the HTML page, the text will be hidden for most visitors, but clearly readable if the visitor disables styles, uses a screen reader device, views the HTML source of the page, or is a bot, like a search engine bot or a spam bot.
You should never hide secrets in wikistyles (very easy to circumvent) or in conditional markup (anyone who can edit even a single page on your wiki may be able to read conditionally protected blocks in other pages; if the source
action is not explicitly protected, even non-editors can view the wiki source text). To hide secrets, place them in separate pages and set passwords on these pages.
Documentation, Internationalization
The documentation updated:
- Forms: added note about
(:input select:)
which arguments apply to the outer <select> tag and which to the inner <option> tags. - Functions: added sections about how to replace in your addons the functions PCCF() and the PPRE() which should no longer be used as of PHP 7.2.
- PasswordsAdmin: added example how to lock an action, and emphasized note about not keeping plaintext passwords in config files.
- Troubleshooting: added section about deprecated usage of the crypt() function.
The German documentation was updated. You can download it here.
Discussions
On the mailing list:
- A bug report and suggestions about the Worse editor.
- A thread about updating the recipe LazyWebLinks for recent PHP versions.
- A bug report with the recipe AlternateNamingScheme.
In the PITS: PmWiki Issue Tracking System (please comment, vote):
- 01320 (Is there a page size limit?) A report that the bug might be caused by the SectionEdit recipe.
- 01412 (PmWiki.org integrated developer platform) The discussion continues about profile pages as password storage (please comment, vote).
- 01421 (crypt() deprecated, but still in pmwiki.php core) This prompted the documentation of PmWiki.Troubleshooting#crypt.
- 01422 (WikiTrails Path trail syntax broken on 2.2.103) The bug was fixed in 2.2.104.
- 01423 (CondAuth in farmconfig.php disables
$DefaultPasswords
in config.php) A long discussion with examples with the (least bad) way to call core functions like CondAuth() or PageVar() from (farm)config.php.
Cookbook (addons, modules, skins)
- B3 blog (Easy to install and use wiki blogging system) by Petko : Fix minor bug with localized timestamps when the hour is <= 9.
- ExpireDiff (How to remove a page's history) by Petko : Fix undefined $keepdays integer value 0 when not set.
- PmDocConvert (PmDocConvert makes it easy to upload and display formats that can be handled by OpenOffice.org on a PmWiki page.) by ccox : Updated to 20171012.
- Vanilla5 (Vanilla5 is a simple HTML5 compliant skin for PmWiki v2+) by PaulWiegmans : Fixed folder was missing HTML5Shiv for legacy Internet Explorer (also updated on pmwiki.org).
- Worse (is better) (Simple WYSIWYG editing for PmWiki) by Petko : Accept more flexible responses (trailing spaces or new lines) for saved pages, reported by Walter Keller. Remind about
?action=worserecache
.
Discussions:
- AddToWatchlist-Talk (Add or remove a page from your watchlist trail with a single click) by Petko : Reply about automatic custom permissions on watchlist pages (2 workarounds).
- AjaxEditSupport-Talk (Adds a wikipage/attachment/category AJAX browser to Edit pages) by XES : Follow up on bug with word wrap.
- Audio5-Talk (HTML5 Audio Support for PmWiki) by Alan? : Difficulties when including files attached to other groups.
- Blix-Talk (Blix is a two-column theme, with a top navigation tab bar, and traditional footer.) by TL? : The logo needs its width and height to be set, also how to insert space between the logo and the wiki title.
- PmFeed-Talk (RSS feed display for PmWiki.) by XES : Bug report with apostrophes in feed articles.
Recipes reviewed and/or updated and marked compatible with PHP 7.2
- LazyWebLinks Cause markup text beginning with "www." to be automatically converted into a link to an external site by Petko
- Syntaxlove Syntax highlighting with good look and cool JavaScript-effects by MatthiasGünther
(total: 2 pages)
14 comments on "PmWeekly, October 13, 2017"
The host displays the following message whenever I set PHP to version > 5.4:
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/letivbvp/www/wiki/pmwiki.php on line 1758
ERROR: pat=/\( :markup(\s+([^ ]*?))?:\)[^\S ]*\[([ =@ ])(.*?)\3\]/sei preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
Please see Troubleshooting about how to track the add-on that needs upgrade. Also, double check that you have updated all files in the "scripts" directory, as well as pmwiki.php. It is not recommended to rename pmwiki.php to index.php as you may forget to update it and may run obsolete or even vulnerable code.
I find it strange that line 1758 of pmwiki.php in version 2.2.104 still contains preg_replace() in contradiction with explanations on the Troubelshooting page. This is the error that the server is pointing at when running PHP > 5.4.
I did the diagnostic as indicated on Troubleshooting, loading the home page with "action=ruleset". The bits indicating errors all target files contained in "cookbook", for instance:
file: /home/letivbvp/www/wiki/cookbook/sectionedit.php, line: 359, pat: /\( :sectionedit\s+(\S.*?)\s+(\S.*?)\s+(\d.*?)
Indeed, these are old files. The problem is that the "cookbook" folder is empty in the 2.2.104 installation... Where can I get the proper files?
You wrote a message from "action=ruleset" that comes from the sectionedit.php script which is likely part of that recipe, so it is likely included by your wiki configuration. If you want to upgrade it, in the SectionEdit page there is a first section "Solution" with a list of lines each starting with "Download...". If you prefer to disable the recipe, you don't need to download and install the new files, simply disable the "include_once" calls in config.php (remove or comment out by inserting # at the beginning of the lines).
I removed all include_once calls in config.php so that "action=ruleset" no longer indicates any incompatible file.
However it does not yet work. Running PHP 7.1, I still get the same error message:
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/letivbvp/www/wiki/pmwiki.php on line 1758
ERROR: pat=/<(\/?(table|tr|th|td|img|script|span|iframe|b|i|em|u|sup|sub|a|iframe|small|object|param|embed|div|br|blink)(?![a-z!])((['"]).*?\4|.*?)*?)>/ie preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
The code of pmwiki.php in which this error occurs is :
if ($p{0} == '/') {
if (is_callable($r)) $x = preg_replace_callback($p,$r,$x);
else $x=preg_replace($p,$r,$x);
}
I guess that it might work if is_callable() returns TRUE...
Finally I removed every include_once() and Markup() in config.php but I am still getting the following set of errors:
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/letivbvp/www/wiki/pmwiki.php on line 1758
ERROR: pat=/\( :noleft:\)/ei preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/letivbvp/www/wiki/pmwiki.php on line 1758
ERROR: pat=/\( :noright:\)/ei preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/letivbvp/www/wiki/pmwiki.php on line 1758
ERROR: pat=/\( :noaction:\)/ei preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/letivbvp/www/wiki/pmwiki.php on line 1758
ERROR: pat=/\( :notabs:\)/ei preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/letivbvp/www/wiki/pmwiki.php on line 1758
ERROR: pat=/\( :nosearch:\)/ei preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/letivbvp/www/wiki/pmwiki.php on line 1758
ERROR: pat=/\( :notitle:\)/ei preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /home/letivbvp/www/wiki/pmwiki.php on line 1758
ERROR: pat=/\( :notitlegroup:\)/ei preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
These particular messages come likely from the skin - in config.php you'll find the
$Skin
variable, then you can get a more recent version, PHP 5.5 compatible, from the Skins group, or another skin.This comment form is part of B3 blog, but there are other addons in Category.Comments.