PmWeekly, October 13, 2017

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'''@]
  • 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:

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).

  • 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)

Skins & Recipes updated:

  • 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

Cookbook:

  • 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"

  • Bernard Bel: 2017-11-06 07:35 -0600
    I upgraded to 2.2.104.

    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
  • Petko: 2017-11-06 09:45 -0600

    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.

  • Bernard Bel: 2017-11-07 12:12 -0600
    I had replaced the "scripts" directory with the new version.

    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?
  • Petko: 2017-11-07 13:02 -0600
    • Sorry for the confusion, the preg_replace function is not deprecated, one of its modes is (evaluation with the /e flag) and the PmWiki core does not require that mode to function, but some add-ons still do, and their markup rules are processed at that line 1758. This is not a problem for PHP 5.4 and earlier and there is a way to do hide the warnings it in 5.5-7.1 so we simply allow this.
    • Files in the cookbook are add-ons (recipes) which you find in the Cookbook, and here is SectionEdit. The scripts are placed in the cookbook or pub directories (according to installation instructions) and are enabled and configured in the file config.php in the local directory.
  • Bernard Bel: 2017-11-08 01:17 -0600
    • I feel a bit confused about what to do... I guess I should upload recent cookbook files to replace the old ones, but I don't find a link to download the new set of files. (I see that these files will be included by config.php)
    • I do not understand how SectionEdit will be involved in this process.
  • Petko: 2017-11-08 06:55 -0600

    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).

  • Bernard Bel: 2017-11-10 03:20 -0600
    I understand.

    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...
  • Petko: 2017-11-10 03:31 -0600
    You have a pattern that has the /e modifier, here "/ie". I see the pattern after the "ERROR: pat=" part: this is some add-on or configuration that allows writing HTML into the wiki page - it is either "include"d or "require"d from config.php, or it is written as a "Markup(...)" call in the config.php file.
  • Bernard Bel: 2017-11-10 14:21 -0600
    I removed include_once("$FarmD/cookbook/enablehtml.php") which was causing this particular error. However similar errors were still signaled on line 1758.

    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
  • Petko: 2017-11-10 17:09 -0600

    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.

  • Bernard Bel: 2017-11-11 09:19 -0600
    At last it works... Thank you for your patience!
  • Petko: 2017-11-11 12:56 -0600
    Hey, I'm glad we managed so far. If you have any other questions don't hesitate to contact us.
  • Lou: 2019-12-26 22:22 +0000
    Hi! Is it easy for one to get this "leave a reply" thing for one's own site? Is it an ad on or something?
  • Petko: 2019-12-26 22:34 +0000

    This comment form is part of B3 blog, but there are other addons in Category.Comments.

Leave a reply
Your name (required):

Your comment (required):


Enter value: Captcha