diff options
30 files changed, 259 insertions, 154 deletions
diff --git a/docs/sample-config.php b/docs/sample-config.php index fdc7482a..27c665b2 100644 --- a/docs/sample-config.php +++ b/docs/sample-config.php @@ -40,30 +40,34 @@ $Skin = 'pmwiki-responsive'; ## Highly recommended for new wikis. include_once("scripts/xlpage-utf-8.php"); -## If you're running a publicly available site and allow anyone to -## edit without requiring a password, you probably want to put some -## blocklists in place to avoid wikispam. See PmWiki.Blocklist. -# $EnableBlocklist = 1; # enable manual blocklists -# $EnableBlocklist = 10; # enable automatic blocklists +## When installing a new wiki, if you expect to have a large number of +## pages, per-group storage may be appropriate. For migrating existing +## wikis, see Cookbook:PerGroupSubDirectories +# $WikiDir = new PageStore('wiki.d/{$Group}/{$FullName}'); + +## You can enable a number of functions improving your experience +## editing and reviewing pages. This includes LocalTimes, PmSyntax, +## GUIButtons, TableOfContents and more, search the documentation +## for this variable: +# $EnableCommonEnhancements = 1; ## PmWiki comes with graphical user interface buttons for editing; ## to enable these buttons, set $EnableGUIButtons to 1. +## (included in $EnableCommonEnhancements) # $EnableGUIButtons = 1; -## This enables a message if editors have modified a page but try to -## move away from the edit form before saving the text. -$EnableNotSavedWarning = 1; # 1: warn editors; 0: disable warning - ## You can enable syntax highlighting for the documentation and/or ## for the edit form. +## (included in $EnableCommonEnhancements) # $EnablePmSyntax = 1; # or 2, see documentation ## For a basic table of contents, see page PmWiki/TableOfContents +## (included in $EnableCommonEnhancements) # $PmTOC['Enable'] = 1; ## To enable markup syntax from the Creole common wiki markup language ## (http://www.wikicreole.org/), include it here: -# include_once("scripts/creole.php"); +# $EnableCreole = 1; ## Some sites may want leading spaces on markup lines to indicate ## "preformatted text blocks", set $EnableWSPre=1 if you want to do @@ -107,7 +111,7 @@ $UploadPermAdd = 0; # Recommended for most new installations ## By default, viewers are prevented from seeing the existence ## of read-protected pages in search results and page listings, ## but this can be slow as PmWiki has to check the permissions -## of each page. Setting $EnablePageListProtect to zero will +## of each page. Setting $EnablePageListProtect to zero may ## speed things up considerably, but it will also mean that ## viewers may learn of the existence of read-protected pages. ## (It does not enable them to access the contents of the pages.) @@ -115,14 +119,11 @@ $UploadPermAdd = 0; # Recommended for most new installations ## The refcount.php script enables ?action=refcount, which helps to ## find missing and orphaned pages. See PmWiki.RefCount. -# if ($action == 'refcount') include_once("scripts/refcount.php"); +# $EnableRefCount = 1; -## The feeds.php script enables ?action=rss, ?action=atom, ?action=rdf, -## and ?action=dc, for generation of syndication feeds in various formats. -# if ($action == 'rss') include_once("scripts/feeds.php"); # RSS 2.0 -# if ($action == 'atom') include_once("scripts/feeds.php"); # Atom 1.0 -# if ($action == 'dc') include_once("scripts/feeds.php"); # Dublin Core -# if ($action == 'rdf') include_once("scripts/feeds.php"); # RSS 1.0 +## You can enable ?action=rss, ?action=atom, ?action=rdf, and ?action=dc, +## for generation of syndication feeds for Recent Changes pages. +# $EnableFeeds['rss'] = 1; # RSS 2.0 ## By default, pages in the Category group are manually created. ## Uncomment the following line to have blank category pages @@ -131,6 +132,12 @@ $UploadPermAdd = 0; # Recommended for most new installations ## the author has edit permissions to the Category group.) # $AutoCreate['/^Category\\./'] = array('ctime' => $Now); +## If you're running a publicly available site and allow anyone to +## edit without requiring a password, you probably want to put some +## blocklists in place to avoid wikispam. See PmWiki.Blocklist. +# $EnableBlocklist = 1; # enable manual blocklists +# $EnableBlocklist = 10; # enable automatic blocklists + ## PmWiki allows a great deal of flexibility for creating custom markup. ## To add support for '*bold*' and '~italic~' markup (the single quotes ## are part of the markup), uncomment the following lines. @@ -142,8 +149,8 @@ $UploadPermAdd = 0; # Recommended for most new installations ## are turned into links, uncomment the line below. See PmWiki.UrlApprovals. ## Also, setting $UnapprovedLinkCountMax limits the number of unapproved ## links that are allowed in a page (useful to control wikispam). +# $EnableUrlApprove = 1; # $UnapprovedLinkCountMax = 10; -# include_once("scripts/urlapprove.php"); ## The following lines make additional editing buttons appear in the ## edit page for subheadings, lists, tables, etc. @@ -167,6 +167,7 @@ $FmtPV = array( '$GroupHomePageName' => 'FmtGroupHome($pn,$group,$var)', '$GroupHomePageTitle' => 'FmtGroupHome($pn,$group,$var)', '$GroupHomePageTitlespaced' => 'FmtGroupHome($pn,$group,$var)', + '$GroupHomePageUrl' => 'FmtGroupHome($pn,$group,$var)', ); $SaveProperties = array('title', 'description', 'keywords'); $PageTextVarPatterns = array( @@ -176,6 +177,7 @@ $PageTextVarPatterns = array( $WikiTitle = 'PmWiki'; $Charset = 'ISO-8859-1'; +$HTMLHeaderFmt['Content-type'] = ''; $HTTPHeaders = array( "Expires: Tue, 01 Jan 2002 00:00:00 GMT", "Cache-Control: no-store, no-cache, must-revalidate", @@ -846,6 +848,11 @@ function PRCB($pat, $repl, $subj, $vars=null, $limit=-1, &$count=null, $flags=0) return preg_replace_callback($pat, $repl, $subj, $limit, $count, $flags); return preg_replace_callback($pat, $repl, $subj, $limit, $count); } +function PRI($glue, $array) { ## Recursive implode + $out = array(); + foreach($array as $v) $out[] = is_array($v)? PRI($glue, $v) : $v; + return implode($glue, $out); +} ## This is a replacement for json_encode+PHSC, but only for arrays that ## are used by the PmWiki core. It may or may not work in other cases. @@ -1244,7 +1251,7 @@ function MatchNames($list, $pat, $caseinsensitive = true) { } return $list; } - + ## ResolvePageName "normalizes" a pagename based on the current ## settings of $DefaultPage and $PagePathFmt. It's normally used ## during initialization to fix up any missing or partial pagenames. @@ -1500,6 +1507,7 @@ function FmtGroupHome($pn,$group,$var) { $gpn = MakePageName($pn, "$group."); $pv = substr($var, 14); if (!$pv) return $gpn; + if ($pv == 'Url') $pv = 'PageUrl'; return PageVar($gpn, "\$$pv"); } @@ -1507,6 +1515,7 @@ function FmtGroupHome($pn,$group,$var) { ## {$$key} in $text with $vars['key']. function FmtTemplateVars($text, $vars, $pagename = NULL) { global $FmtPV, $EnableUndefinedTemplateVars; + $text = strval($text); if ($pagename) { $pat = implode('|', array_map('preg_quote', array_keys($FmtPV))); $pprc = new PPRC($pagename); @@ -1514,8 +1523,8 @@ function FmtTemplateVars($text, $vars, $pagename = NULL) { array($pprc, 'pagevar'), $text); } foreach(preg_grep('/^[\\w$]/', array_keys($vars)) as $k) - if (!is_array($vars[$k])) - $text = str_replace("{\$\$$k}", @$vars[$k], $text); + if (!is_array($vars[$k]) && $text) + $text = str_replace("{\$\$$k}", strval(@$vars[$k]), $text); if (! IsEnabled($EnableUndefinedTemplateVars, 0)) $text = preg_replace("/\\{\\$\\$\\w+\\}/", '', $text); return $text; @@ -1902,14 +1911,14 @@ function ProcessPrintFmt($pagename,$x) { function PostPrintFmt($pagename,$fmt) { global $EnablePrePrintFmt, $KeepToken, $HTTPHeaders, $FmtV; if (is_array($fmt)) { - foreach($fmt as $f) PostPrintFmt($pagename,$f); + foreach($fmt as $f) PostPrintFmt($pagename,$f); return; } if ($fmt == 'headers:') { foreach($HTTPHeaders as $h) (@$sent++) ? @header($h) : header($h); return; } - $fmt = strval($fmt); + if (!is_string($fmt)) $fmt = strval($fmt); $preprint = IsEnabled($EnablePrePrintFmt, 1); if ($preprint && substr($fmt, 0, 4) == "$KeepToken$KeepToken") { @@ -2197,7 +2206,7 @@ function FormatTableRow($x, $sep = '\\|\\|') { static $rowcount; SDV($TableCellAlignFmt, " align='%s'"); - if (IsEnabled($EnableSimpleTableRowspan, 0)) { + if (IsEnabled($EnableSimpleTableRowspan, 1)) { $x = preg_replace("/\\|\\|__+(?=\\|\\|)/", '||', $x); $x = preg_replace("/\\|\\|\\^\\^+(?=\\|\\|)/", '', $x); } @@ -2207,7 +2216,7 @@ function FormatTableRow($x, $sep = '\\|\\|') { if ($td[$i]=='') continue; $FmtV['$TableCellCount'] = $i; $attr = FmtPageName(@$TableCellAttrFmt, ''); - if (IsEnabled($EnableSimpleTableRowspan, 0)) { + if (IsEnabled($EnableSimpleTableRowspan, 1)) { if (preg_match('/(\\+\\++)\\s*$/', $td[$i], $rspn)) { $td[$i] = preg_replace('/\\+\\++(\\s*)$/', '$1', $td[$i]); $attr .= " rowspan='".strlen($rspn[1])."'"; @@ -2596,7 +2605,7 @@ function UpdatePage(&$pagename, &$page, &$new, $fnlist = NULL) { # EditTemplate allows a site administrator to pre-populate new pages # with the contents of another page. function EditTemplate($pagename, &$page, &$new) { - global $EditTemplatesFmt, $ROEPatterns, $TROEPatterns; + global $EditTemplatesFmt, $TROEPatterns; if (@$new['text'] > '') return; $rqt = @$_REQUEST['template']; if ($rqt && PageExists($rqt)) { diff --git a/pub/guiedit/pmwiki.syntax.css b/pub/guiedit/pmwiki.syntax.css index 9a3066f3..e1b641dd 100644 --- a/pub/guiedit/pmwiki.syntax.css +++ b/pub/guiedit/pmwiki.syntax.css @@ -252,6 +252,9 @@ code.pmhlt, .pmhlt code, #htext.pmhlt { word-wrap: break-word; overflow-wrap: break-word; } +#wikiedit #htext * { + line-height: var(--pmsyntax-lineheight); +} #wikiedit #hwrap #htext { display: none; position: absolute; diff --git a/pub/guiedit/pmwiki.syntax.js b/pub/guiedit/pmwiki.syntax.js index 3dbd65a2..57d0f09a 100644 --- a/pub/guiedit/pmwiki.syntax.js +++ b/pub/guiedit/pmwiki.syntax.js @@ -92,7 +92,7 @@ // directives, forms ['form', '!directive>keyword', /(\(:input[^\S\r\n]+)(\S.*?)(:\))/g, - /^((pm)?form|text(area)?|radio|checkbox|select|email|tel|number|defaults?|submit|reset|hidden|password|search|url|date|month|color|datalist|file|image|reset|button|e_\w+|captcha|pmtoken|end)/], + /^((pm)?form|text(area)?|radio|checkbox|select|email|tel|number|defaults?|submit|reset|hidden|password|search|url|date|month|color|datalist|file|image|reset|button|e_\w+|captcha|pmtoken|end|star)/], ['dir0', '*directive', /\(:\w[-\w]* *:\)/g], // simple ['dir1', '!directive', /(\(:\w[-\w]*)(.*?)(:\))/g], // with attributes @@ -112,6 +112,8 @@ // simple tables ['tablecapt', '=table', /^(\|\|!)(.+)(!\|\|)$/mg], + ['tablerwsp1', 'table', /(\+\++)(?=\s*\|\|)/g], + ['tablerwsp2', 'escaped', /\|\|(__+|\^\^+)(?=\|\|)/g, /([_^]+)/], ['tablerow', '!table', /^\|\|.*\|\|.*$/mg, /((?:\|\|)+)(!?)/g], ['tableattr', '!table', /^(\|\|)(.*)($)/mg], diff --git a/pub/pmwiki-utils.js b/pub/pmwiki-utils.js index c15dab6e..0dd8c371 100644 --- a/pub/pmwiki-utils.js +++ b/pub/pmwiki-utils.js @@ -28,6 +28,7 @@ function aE(el, ev, fn) { if(typeof el == 'string') el = dqsa(el); + else if(el instanceof Element) el = [el]; for(var i=0; i<el.length; i++) el[i].addEventListener(ev, fn); } function dqs(str) { return document.querySelector(str); } @@ -36,10 +37,14 @@ function tap(q, fn) { aE(q, 'click', fn); }; function pf(x) {var y = parseFloat(x); return isNaN(y)? 0:y; } function zpad(n) {return (n<10)?"0"+n : n; } - function adjbb(el, html) { el.insertAdjacentHTML('beforebegin', html); } - function adjbe(el, html) { el.insertAdjacentHTML('beforeend', html); } - function adjab(el, html) { el.insertAdjacentHTML('afterbegin', html); } - function adjae(el, html) { el.insertAdjacentHTML('afterend', html); } + function adjany(el, where, what) { + if(what instanceof Element) el.insertAdjacentElement(where, what); + else el.insertAdjacentHTML(where, what); + } + function adjbb(el, what) { adjany(el, 'beforebegin', what); } + function adjbe(el, what) { adjany(el, 'beforeend', what); } + function adjab(el, what) { adjany(el, 'afterbegin', what); } + function adjae(el, what) { adjany(el, 'afterend', what); } function getLS(key, parse) { try { var x = window.localStorage.getItem(key)|| null; @@ -615,12 +620,12 @@ Dropzone.pmareq = areq; } - form.insertAdjacentElement('afterbegin', Dropzone); - aE([Dropzone], 'dragenter', dragenter); - aE([Dropzone], 'dragover', dragenter); - aE([Dropzone], 'dragleave', dragleave); - aE([Dropzone], 'drop', dragdrop); - tap([Dropzone], clickzone); + adjab(form, Dropzone); + aE(Dropzone, 'dragenter', dragenter); + aE(Dropzone, 'dragover', dragenter); + aE(Dropzone, 'dragleave', dragleave); + aE(Dropzone, 'drop', dragdrop); + tap(Dropzone, clickzone); } async function postUpload(file) { @@ -752,11 +757,32 @@ Dropzone.appendChild(a); } + function makeDraggable(par) { + var children = par.children; + if(children.length<2) return; + for(var i=0; i<children.length; i++) { + var child = children[i]; + child.draggable = true; + } + par.style.cursor = "move"; + aE(par, 'dragstart', function(e){ this.dragged_element = e.target; }); + aE(par, 'dragover', function(e){e.preventDefault();}); + aE(par, 'drop', function(e){ + var c = [...this.children], d = this.dragged_element, t = e.target; + if(!d || d==t) return; + var b = c.indexOf(t) < c.indexOf(d) ? t : t.nextSibling; + this.insertBefore(d, b); + }); + } + function init_draggable() { + var els = dqsa('.draggable'); + for(var el of els) makeDraggable(el); + } function ready(){ wikitext = document.getElementById('wikitext'); var fn = [autotoc, inittoggle, PmXMail, localTimes, - highlight_pre, copy_pre, confirmForms, init_dropzone]; + highlight_pre, copy_pre, confirmForms, init_dropzone, init_draggable]; fn.forEach(function(a){a();}); makesortable(); } diff --git a/pub/skins/pmwiki-responsive/skin.php b/pub/skins/pmwiki-responsive/skin.php index 698631be..52e6c389 100644 --- a/pub/skins/pmwiki-responsive/skin.php +++ b/pub/skins/pmwiki-responsive/skin.php @@ -26,20 +26,6 @@ SDV($EnableDarkThemeToggle, 3); # For (:searchbox:), valid semantic HTML5 $SearchBoxInputType = "search"; -# remove deprecated "name=" parameter from anchor tags -if($GLOBALS['VersionNum'] < 2002056) { - # we want the skin to also work with older PmWiki versions - Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/e', - "Keep(TrackAnchors('$1') ? '' : \"<a id='$1'></a>\", 'L')"); -} -else { - Markup('[[#','<[[','/(?>\\[\\[#([A-Za-z][-.:\\w]*))\\]\\]/', - "MarkupKeepTrackAnchors"); -} -function MarkupKeepTrackAnchors($m) { - return Keep(TrackAnchors($m[1]) ? '' : "<a id='{$m[1]}'></a>", 'L'); -} - # in HTML5 "clear" is a style not an attribute Markup('[[<<]]','inline','/\\[\\[<<\\]\\]/',"<br class='clearboth' />"); @@ -76,9 +62,19 @@ function SkinFmt($pagename, $args) { return; # Section was disabled by (:noheader:) or (:nofooter:) } + static $pagecache = array(); foreach($args as $p) { $pn = FmtPageName($p, $pagename); - $elm = RetrieveAuthSection($pn, "$section{$section}end"); + if(! isset($pagecache[$pn])) { + $page = RAPC($pn); + $pagecache[$pn] = strval(@$page['text']); + } + if($pagecache[$pn] == "") continue; + $rx = "/\\[\\[$section\\]\\](?: *\n+)?(.*?)\\s*\\[\\[{$section}end\\]\\]/s"; + if(preg_match($rx, $pagecache[$pn], $m)) { + $elm = $m[1]; + } + else continue; if(!$elm) continue; $html = MarkupToHTML($pagename, Qualify($pn, $elm)); diff --git a/scripts/blocklist.php b/scripts/blocklist.php index 836ae999..c0571b34 100644 --- a/scripts/blocklist.php +++ b/scripts/blocklist.php @@ -46,7 +46,7 @@ ## but at some point we may change the default to disabled. if (IsEnabled($EnableBlocklistImmediate, 1)) { SDVA($BlocklistActions, array('comment' => 1)); - $ptext = implode(' ', @$_POST); + $ptext = PRI(' ', @$_POST); if ($ptext && @$BlocklistActions[$action]) { Blocklist($pagename, $ptext); if (!$EnablePost) { @@ -62,7 +62,7 @@ if (IsEnabled($EnableBlocklistImmediate, 1)) { ## periodically download the "moinmaster" blocklists. if ($EnableBlocklist >= 10) { SDVA($BlocklistDownload['SiteAdmin.Blocklist-MoinMaster'], array( - 'url' => 'http://moinmo.in/BadContent?action=raw', + 'url' => 'https://moinmo.in/BadContent?action=raw', 'format' => 'regex')); } diff --git a/scripts/forms.php b/scripts/forms.php index 3c700415..9a5d0f12 100644 --- a/scripts/forms.php +++ b/scripts/forms.php @@ -394,9 +394,25 @@ SDVA($InputTags['e_changesummary'], array( 'value' => PHSC(stripmagic(@$_POST['csum']), ENT_QUOTES))); SDVA($InputTags['e_minorcheckbox'], array( ':html' => "<input type='checkbox' \$InputFormArgs />\$InputFormLabel", - 'name' => 'diffclass', 'value' => 'minor')); + 'name' => 'diffclass', 'value' => 'minor', + 'label'=>PHSC(XL('This is a minor edit'), ENT_QUOTES))); if (@$_POST['diffclass']=='minor') SDV($InputTags['e_minorcheckbox']['checked'], 'checked'); + +if (IsEnabled($EnableMergeLastMinorEdit, 0)>=1 && @$Author && PageExists($pagename)) { + if ($EnableMergeLastMinorEdit >= 120) { + $ltime = intval(PageVar($pagename, '$LastModifiedTime'))+$EnableMergeLastMinorEdit; + $samehost = PageVar($pagename, '$LastModifiedHost') == $_SERVER['REMOTE_ADDR']; + } + if ($EnableMergeLastMinorEdit < 120 || ($ltime>$Now && $samehost)) { + $InputTags['e_minorcheckbox']['label'] .= + " " . PHSC(XL('(merge with previous edit)'), ENT_QUOTES); + SDV($InputTags['e_minorcheckbox']['title'], + PHSC(XL('Merge the new edit with the last one, if by the same author, and reuse the change summary if left empty'), ENT_QUOTES)); + } + unset($ltime, $samehost); +} + SDVA($InputTags['e_savebutton'], array( ':html' => "<input type='submit' \$InputFormArgs />", 'name' => 'post', 'value' => ' '.XL('Save').' ', diff --git a/scripts/pmform.php b/scripts/pmform.php index 918da0d2..32fdcce4 100644 --- a/scripts/pmform.php +++ b/scripts/pmform.php @@ -61,7 +61,7 @@ function PmFormConfig($pagename, $target) { function PmFormTemplateDirective($text, $pat, &$match) { $pat = "/((?<=\n) *)?\\(:template +$pat\\b(.*?):\\)(?(1) *\n)/"; - return preg_match_all($pat, $text, $match, PREG_SET_ORDER); + return preg_match_all($pat, strval(@$text), $match, PREG_SET_ORDER); } diff --git a/scripts/stdconfig.php b/scripts/stdconfig.php index b7d33a91..dd8d763c 100644 --- a/scripts/stdconfig.php +++ b/scripts/stdconfig.php @@ -42,6 +42,46 @@ while(count($PostConfig)) { elseif (file_exists($k)) include_once($k); } +if (IsEnabled($EnableCommonEnhancements,0)) { + # Security + review changes + SDV($EnableCookieHTTPOnly, 1); + SDV($EnableObfuscateEmails, 1); + SDV($EnableRCDiffBytes, 1); + SDV($EnableLocalTimes, 3); + + # Editing + SDV($EnablePreviewChanges, 1); + SDV($EnableMergeLastMinorEdit, 12*3600); + SDV($EnableListIncludedPages, 1); + SDV($EnablePmSyntax, 2); + SDV($EnableEditAutoText, 1); + SDV($EnableGUIButtons, 1); + SDV($EnableGuiEditFixUrl, 220); + + # Documentation + SDVA($PmTOC, array('Enable'=>1, 'EnableBacklinks'=>1)); + SDV($EnableCopyCode, 1); + + # Uploads (if enabled) + SDV($EnableUploadDrop, 1); + SDV($EnableRecentUploads, 1); + SDV($EnableUploadVersions, 1); +} + +if (IsEnabled($EnableUrlApprove, 0)) + include_once("$FarmD/scripts/urlapprove.php"); + +if (IsEnabled($EnablePmForm, 0)) + include_once("$FarmD/scripts/pmform.php"); + +if (IsEnabled($EnableCreole, 0)) + include_once("$FarmD/scripts/creole.php"); + +if (IsEnabled($EnableRefCount, 0) && $action == 'refcount') + include_once("$FarmD/scripts/refcount.php"); + +if (isset($EnableFeeds[$action]) && $EnableFeeds[$action]) + include_once("$FarmD/scripts/feeds.php"); if (IsEnabled($EnableRobotControl,1)) diff --git a/scripts/stdmarkup.php b/scripts/stdmarkup.php index 4abff4d8..50d73d29 100644 --- a/scripts/stdmarkup.php +++ b/scripts/stdmarkup.php @@ -18,6 +18,12 @@ Script maintained by Petko YOTOV www.pmwiki.org/petko */ +## for simpler configuration +if (IsEnabled($EnableObfuscateEmails, 0)) + $LinkFunctions['mailto:'] = 'ObfuscateLinkIMap'; +if (IsEnabled($EnablePreserveLineBreaks, 0)) + $HTMLPNewline = '<br/>'; + ## first we preserve text in [=...=] and [@...@] function PreserveText($sigil, $text, $lead) { if ($sigil=='=') return $lead.Keep($text); @@ -337,7 +343,7 @@ function MarkupLinks($m){ return Keep(MakeLink($pagename,$m[1], '['.++$GLOBALS['MarkupFrame'][0]['ref'].']'),'L'); case '[[#': - return Keep(TrackAnchors($m[1]) ? '' : "<a name='{$m[1]}' id='{$m[1]}'></a>", 'L'); + return Keep(TrackAnchors($m[1]) ? '' : "<a id='{$m[1]}'></a>", 'L'); case 'urllink': return Keep(MakeLink($pagename,$m[0],$m[0]),'L'); case 'mailto': diff --git a/scripts/utils.php b/scripts/utils.php index a26b786c..cf3423d5 100644 --- a/scripts/utils.php +++ b/scripts/utils.php @@ -64,7 +64,7 @@ function PmUtilsJS($pagename) { if (file_exists($utils)) { $mtime = filemtime($utils); $config = array( - 'sortable' => IsEnabled($EnableSortable, 0), + 'sortable' => IsEnabled($EnableSortable, 1), 'highlight' => IsEnabled($EnableHighlight, 0), 'copycode' => $cc, 'toggle' => IsEnabled($ToggleNextSelector, 0), diff --git a/scripts/version.php b/scripts/version.php index 01309b5e..979ae3c7 100644 --- a/scripts/version.php +++ b/scripts/version.php @@ -1 +1 @@ -<?php $Version="pmwiki-2.3.36"; $VersionNum=2003036;
\ No newline at end of file +<?php $Version="pmwiki-2.3.37"; $VersionNum=2003037;
\ No newline at end of file diff --git a/scripts/xlpage-utf-8.php b/scripts/xlpage-utf-8.php index 34f9c1ae..a77a698b 100644 --- a/scripts/xlpage-utf-8.php +++ b/scripts/xlpage-utf-8.php @@ -24,8 +24,8 @@ global $HTTPHeaders, $KeepToken, $pagename, $Charset, $HTMLHeaderFmt, $StrFoldFunction, $AsSpacedFunction; $Charset = 'UTF-8'; -$HTTPHeaders['utf-8'] = 'Content-type: text/html; charset=UTF-8'; -$HTMLHeaderFmt['utf-8'] = +$HTTPHeaders['Content-type'] = 'Content-type: text/html; charset=UTF-8'; +$HTMLHeaderFmt['Content-type'] = "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />"; SDVA($HTMLStylesFmt, array('rtl-ltr' => " .rtl, .rtl * {direction:rtl; unicode-bidi:bidi-override;} diff --git a/wikilib.d/PmWiki.BasicEditing b/wikilib.d/PmWiki.BasicEditing index aa2b4fe3..ecd68330 100644 --- a/wikilib.d/PmWiki.BasicEditing +++ b/wikilib.d/PmWiki.BasicEditing @@ -1,11 +1,11 @@ -version=pmwiki-2.3.31 ordered=1 urlencoded=1 +version=pmwiki-2.3.36 ordered=1 urlencoded=1 author=Petko charset=UTF-8 -csum=tooltip title to a link, add it in quotes (+289) +csum=$EnablePreserveLineBreaks (-7) description=PmWiki's basic editing rules name=PmWiki.BasicEditing -rev=591 +rev=592 targets=PmWiki.WikiSandbox,Main.WikiSandbox,PmWiki.DocumentationIndex,PmWiki.WikiWikiWeb,PmWiki.Passwords,PmWiki.TextFormattingRules,PmWiki.MarkupMasterIndex,PmWiki.WikiStyles,PmWiki.ListStyles,PmWiki.WikiGroup,PmWiki.InterMap,PmWiki.NonexistentPages,PmWiki.Links,PmWiki.Tables,PmWiki.TableDirectives,PmWiki.Images,PmWiki.PageLists,PmWiki.PageTextVariables,PmWiki.PageListTemplates,PmWiki.BasicEditing,PmWiki.WikiTrails,PmWiki.SpecialCharacters,PmWiki.LayoutVariables,PmWiki.PmWikiPhilosophy,PmWiki.Audiences,Cookbook.EnableHTML -text=(:Audience: authors (basic) :)%0aThe pages on this site are [[wiki(WikiWeb)]]-based pages, which means that pages can be created and edited by multiple authors. To edit a page, click the '''Edit''' link that exists '''somewhere''' on the page, usually in the header or footer. Some pages may be [[password(s)]]-protected, depending on the system's security policies, but many systems allow open editing of pages.%0a%0aPmWiki is not [[(Wikipedia:)WYSIWYG]] - When editing a page, you see the ''markup text'' that describes the content of the page. The basic rules for page markup are simple:%0a# Use a blank line to start a new paragraph [-[[#Paragraphs|more]]-].%0a# To make a list, start each line with %25pmhlt%25@@#@@ for numbered (ordered) lists or @@*@@ for bulleted (unordered) lists [-[[#lists|more]]-].%0a# To make a heading, start a line with two or more %25pmhlt%25@@!@@ marks; @@!!@@ is a subheading, and @@!!!@@ is a sub-subheading [-[[#headings|more]]-].%0a# To emphasize text, enclose it in 2 or 3 ''single quotes''; %25pmhlt%25[@''text''@] for italics or [@'''text'''@] for bold [-[[#emphasis|more]]-].%0a# To make a [[#links | link to another page]], enclose the page's name in double brackets; for example %25pmhlt%25[@[[basic editing]]@] links to this page.%0a# To make a [[#links|link to another site]], type its address, such as %25pmhlt%25[@[[https://example.com/]]@]. Email links must have "@@mailto:@@" before such as [@mailto:xyz@example.com@]%0a%0a%0a'''If you want to experiment with editing a page, try it on the [[Main/Wiki Sandbox]].''' You can [[Main/WikiSandbox?action=edit | edit the Wiki Sandbox]] without affecting anything important on this site. On talk pages and discussions, it's courteous to '''sign''' your contribution; using %25pmhlt%25@@[=~~=]~@@ effectively 'signs' the name that you provide in the Author field on the Page Edit form.%0a%0a!! Examples of common markups%0a%0aThe tables below demonstrate many of the common markups used to format pages. The left column shows what to write to achieve the effect, the right column shows the effect of the markup. More details are available from the [[text formatting rules]] and other documentation pages. An exhaustive list of default markup is available as the [[markup master index]].%0a%0a!! [[#Paragraphs]]Paragraphs and line breaks%0a[[#markupheaders]]%0a(:table class='markup horiz' align='center':)%0a(:cellnr class='markup1':)%0a[-'''What to type'''-]%0a(:cell class='markup2':)%0a[-'''What it looks like'''-]%0a(:tableend:)%0a[[#markupheadersend]]%0a%0a(:markup class=horiz:)%0aConsecutive lines%0awill be merged together%0aas part of the same paragraph.%0a%0aOne or more empty lines will start a new paragraph.%0a(:markupend:)%0a%0a(:markup class=horiz:)%0aTwo backslashes at the end of a line \\%0aforce a line break.%0a%0aOr use this markup: [[%3c%3c]] to force a break.%0a(:markupend:)%0aFurther reading:%0a* [[text formatting rules]] for more information on linebreaks, indented or hanging paragraphs.%0a* [[wiki styles]] for centered or right justified paragraphs and "floating" text (boxes), borders and much more.%0a%0a!![[#lists]]Lists%0aStart each line with @@#@@ for numbered (ordered) lists or @@*@@ for bulleted (unordered) lists:%0a%0a(:markup class=horiz:)%0a* Bullet list%0a* Another item%0a** More asterisks produce sub-items%0a** etc.%0a(:markupend:)%0a%0a(:markup class=horiz:)%0a# Numbered lists%0a# Another item%0a## more hashes produce sub-items%0a(:markupend:)%0a%0a(:markup class=horiz:)%0a# List types%0a# can be mixed%0a** numbered list with unordered sub-list%0a(:markupend:)%0a%0a(:if false:)%0aif someone thinks definition lists are "basic":%0a(:markup class=horiz:)%0a: Definition list : list of definitions%0a: item : the item's definition%0a: another item : that item's definition%0a:: indentation : more leading colons produce deeper lists%0a(:markupend:)%0a(:ifend:)%0a%0aLearn more about [[Text Formatting Rules#BulletedLists|lists]] (including [[Text Formatting Rules#DefinitionLists|definition lists]]) and [[list styles]].%0a%0a!![[#headings]] Headings%0aHeadings are useful for creating a "well-structured" page. They're not just for making big text.%0a%0a(:include {$FullName}#markupheaders#markupheadersend:)%0a%0a(:markup class=horiz:)%0a!! Major Subheading%0a!!! Minor Subheading%0a!!!! And More%0a!!!!! Subheadings%0a(:markupend:)%0a%0a!![[#emphasis]] Text emphasis%0aTo emphasize, enclose text in apostrophes (single-quote marks), not double-quotes.%0a%0a(:include {$FullName}#markupheaders#markupheadersend:)%0a%0a(:markup class=horiz:)%0a''Emphasize'' (italics),%0a'''strong''' (bold), %0a'''''very strong''''' (bold italics).%0a(:markupend:)%0a%0a!![[#links]] Links%0aTo make a link to another page, enclose the page's name in double square brackets.%0a%0a(:include {$FullName}#markupheaders#markupheadersend:)%0a%0a(:markup class=horiz:)%0aPractice editing in the [[wiki sandbox]]%0a(:markupend:)%0aNote that words are automatically ''capitalized'' in page titles. The link above links to the page WikiSandbox.%0a%0aText after a pipe (|) is used as the link text:%0a(:markup class=horiz:)%0aPractice editing in the%0a[[WikiSandbox | practice area]].%0a(:markupend:)%0a%0a(:comment is this still "basic" or should it be removed? :)%0aEndings become part of the link text, parentheses hide parts of the link name:%0a(:markup class=horiz:)%0a[[wiki sandbox]]es.%0a%0a[[(wiki) sandbox]].%0a(:markupend:)%0a%0aWhen linking to a page in a different [[WikiGroup]], provide the group name, followed by a separator, and then the page name:%0a(:markup class=horiz:)%0a[[Main.Wiki Sandbox]] shows group + name%0a%0a[[Main/Wiki Sandbox]] shows only name%0a(:markupend:)%0a%0aLinks to external sites%0a(:markup class=horiz:)%0abare url: https://www.pmwiki.org%0a%0alink text: [[https://www.pmwiki.org | PmWiki home]]%0a(:markupend:)%0a%0aLinks as reference to external sites%0a(:markup class=horiz:)%0abare url: https://www.pmwiki.org%0a%0alink text: [[https://www.pmwiki.org | #]]%0a(:markupend:)%0a%0aTo add a tooltip title to a link, add it in quotes after the page name or the URL:%0a(:markup:)%0aHover your mouse cursor over the links to see the tooltip.%0a* [[Documentation Index"Return to our help center"]]%0a* [[https://www.pmwiki.org"Collaborative Wiki-based CMS" | PmWiki]]%0a(:markupend:)%0a%0a(:comment is this still "basic" or should it be removed? :)%0aColons make [[InterMap]] (also called InterWiki) links to other wikis:%0a(:markup class=horiz:)%0aWhat's an [[Wikipedia:aardvark]], anyway?%0a(:markupend:)%0a%0aLinks to [[nonexistent pages]] are displayed specially, to invite others to create the page.%0a%0aPmWiki supports more link types and a lot of display options, see [[Links]] to learn more.%0a%0a!! Escape sequence [[#escape]]%0aIf you don't want Wiki markup to be processed, but lines reformatted use %25pmhlt%25[@[= =]@]. Can also be used inline.%0a(:markup class=horiz:)%0a[=%0amarkup is ''not'' processed%0abut lines are reformatted%0a=]%0a(:markupend:)%0a%0a!!Preformatted text [[#preformatted]]%0aPreformatted text is displayed using a monospace font and not generating linebreaks except where explicitly indicated in the markup.%0a%0aNote that very long lines of preformatted text can cause the whole page to be wide.%0a%0aFor preformatted text with markup (e.g. emphasis) being processed, start each line with a space:%0a(:markup class=horiz:)%0a Lines that begin with a space%0a are formatted exactly as typed%0a in a '''fixed-width''' font.%0a(:markupend:)%0a%0aIf you don't want Wiki markup to be processed, use %25pmhlt%25@@[=[@ @]=]@@. Can also be used inline.%0a(:markup class=horiz:)%0a[@%0aText escaped this way has%0athe HTML ''code'' style%0a@]%0a(:markupend:)%0a%0aYou can also use the [[#escape|escape sequence]] preceded with a space on the first line.%0a(:markup class=horiz:)%0a [=The '''escape sequence''',%0apreceded by space(s) on the first line,%0ais rendered preformatted.=]%0a(:markupend:)%0a%0aYou can enable [[WikiStyles#highlight|code highlighting]] for preformatted blocks with recent PmWiki versions.%0a%0a!! Horizontal line%0a(:markup class=horiz:)%0aFour or more dashes at%0athe beginning of a line%0a----%0aproduce a "horizontal rule"%0a(:markupend:)%0a%0a!! Tables%0aSimple tables use double pipe characters to separate cells:%0a(:markup class=horiz:)%0a|| border=1%0a||! head 1 ||! head 2 ||! head 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0aSee [[Tables|simple tables]] and [[Table Directives|advanced tables]] to learn more about the rich feature set of PmWiki tables.%0a%0a!! Images%0aSee [[Images]]%0a%0a%0a!! Character formatting%0a%0a(:include {$FullName}#markupheaders#markupheadersend:)%0a%0a(:markup class=horiz:)%0a* @@Monospaced text@@%0a* Text with '^superscripts^'%0a* Text with '_subscripts_'%0a* deleted {-strikethrough-} text%0a* inserted {+underline+} text%0a* [+big+], [++bigger++] text%0a* [-small-], [--smaller--] text%0a(:markupend:)%0a%0aUse [[WikiStyles]] to change %25red%25 the %25blue%25 text %25green%25 %25color=#ff7f00%25 color %25%25.%0a%0a[[#pagetitles]]%0a!! Page titles%0aThe %25pmhlt%25[@(:title:)@] directive sets the page's title to something other than its page name.%0a(:markup class=horiz:)%0a(:Title Basic PmWiki editing rules:)%0aThe name of this page is "{$Name}", and its title is "{$Title}".%0a(:markupend:)%0a%0a[[#pagedesc]]%0a!! Page description%0a* The %25pmhlt%25[@(:Description Page description here:)@] directive sets the page description. The description is used by search engines, and can be displayed in search results and in [[page lists]].%0a(:markup class=horiz:)%0a(:Description PmWiki's basic editing rules:)%0aThe summary description of this page is "{$Description}".%0a(:markupend:)%0a%0a[[#pagesummary]]%0a!! Page summary%0a* %25pmhlt%25@@[=(:=]Summary:Page summary here:)@@ is a [[PageTextVariable(s)]] that is used in some of the default [[PageList templates]].%0a(:markup class=horiz:)%0a(:Summary:PmWiki's basic edit syntax:)%0aThe summary of this page is "{$:Summary}".%0a(:markupend:)%0a%0a%0a%0a>>faq%3c%3c [[#faq]]%0a[[#beginning]]%0aQ: I'm new to PmWiki, where can I find some basic help for getting started?%0aA: The [[Basic Editing]] page is a good start. From there, you can just follow the navigational links at the top or the bottom of the page (they are called [[Wiki Trails]]) to the next pages, or to the [[Documentation Index]] page, which provides an outline style index of essential documentation pages, organized from basic to advanced.%0a%0aQ: How do I include special characters such as Copyright (©) and Trademark (® or ™) on my wiki pages?%0aA: See [[special characters]] on how to insert special characters that don't appear on your keyboard.%0a%0aQ: How can I preserve line-breaks from the source text?%0aA: PmWiki normally treats consecutive lines of text as being a paragraph, and merges and wraps lines together on output. This is consistent with most other wiki packages. An author can use the %25pmhlt%25[@(:linebreaks:)@] directive to cause the following lines of markup text in the page to be kept as separate lines in the output. Or a wiki administrator can set in ''config.php'' %25hlt php%25@@$HTMLPNewline = '%3cbr/>';@@ to force literal new lines for the whole site.%0a%0aQ: Can I just enter HTML directly?%0aA: By default (and by design), PmWiki does not support the use of HTML elements in the editable markup for wiki pages. There are a number of reasons for this described in the [[PmWiki Philosophy]] and [[Audiences]]. Enabling HTML markup within wiki pages in a collaborative environment may exclude some potential authors from being able to edit pages, and pose a number of display and security issues. However, a site administrator can use the [[Cookbook:Enable HTML]] recipe to enable the use of HTML markup directly in pages.%0a%0aQ: Where can I find more documentation?%0aA: See the [[Documentation Index | documentation index]] and the [[markup master index]] pages. -time=1709196610 +text=(:Audience: authors (basic) :)%0aThe pages on this site are [[wiki(WikiWeb)]]-based pages, which means that pages can be created and edited by multiple authors. To edit a page, click the '''Edit''' link that exists '''somewhere''' on the page, usually in the header or footer. Some pages may be [[password(s)]]-protected, depending on the system's security policies, but many systems allow open editing of pages.%0a%0aPmWiki is not [[(Wikipedia:)WYSIWYG]] - When editing a page, you see the ''markup text'' that describes the content of the page. The basic rules for page markup are simple:%0a# Use a blank line to start a new paragraph [-[[#Paragraphs|more]]-].%0a# To make a list, start each line with %25pmhlt%25@@#@@ for numbered (ordered) lists or @@*@@ for bulleted (unordered) lists [-[[#lists|more]]-].%0a# To make a heading, start a line with two or more %25pmhlt%25@@!@@ marks; @@!!@@ is a subheading, and @@!!!@@ is a sub-subheading [-[[#headings|more]]-].%0a# To emphasize text, enclose it in 2 or 3 ''single quotes''; %25pmhlt%25[@''text''@] for italics or [@'''text'''@] for bold [-[[#emphasis|more]]-].%0a# To make a [[#links | link to another page]], enclose the page's name in double brackets; for example %25pmhlt%25[@[[basic editing]]@] links to this page.%0a# To make a [[#links|link to another site]], type its address, such as %25pmhlt%25[@[[https://example.com/]]@]. Email links must have "@@mailto:@@" before such as [@mailto:xyz@example.com@]%0a%0a%0a'''If you want to experiment with editing a page, try it on the [[Main/Wiki Sandbox]].''' You can [[Main/WikiSandbox?action=edit | edit the Wiki Sandbox]] without affecting anything important on this site. On talk pages and discussions, it's courteous to '''sign''' your contribution; using %25pmhlt%25@@[=~~=]~@@ effectively 'signs' the name that you provide in the Author field on the Page Edit form.%0a%0a!! Examples of common markups%0a%0aThe tables below demonstrate many of the common markups used to format pages. The left column shows what to write to achieve the effect, the right column shows the effect of the markup. More details are available from the [[text formatting rules]] and other documentation pages. An exhaustive list of default markup is available as the [[markup master index]].%0a%0a!! [[#Paragraphs]]Paragraphs and line breaks%0a[[#markupheaders]]%0a(:table class='markup horiz' align='center':)%0a(:cellnr class='markup1':)%0a[-'''What to type'''-]%0a(:cell class='markup2':)%0a[-'''What it looks like'''-]%0a(:tableend:)%0a[[#markupheadersend]]%0a%0a(:markup class=horiz:)%0aConsecutive lines%0awill be merged together%0aas part of the same paragraph.%0a%0aOne or more empty lines will start a new paragraph.%0a(:markupend:)%0a%0a(:markup class=horiz:)%0aTwo backslashes at the end of a line \\%0aforce a line break.%0a%0aOr use this markup: [[%3c%3c]] to force a break.%0a(:markupend:)%0aFurther reading:%0a* [[text formatting rules]] for more information on linebreaks, indented or hanging paragraphs.%0a* [[wiki styles]] for centered or right justified paragraphs and "floating" text (boxes), borders and much more.%0a%0a!![[#lists]]Lists%0aStart each line with @@#@@ for numbered (ordered) lists or @@*@@ for bulleted (unordered) lists:%0a%0a(:markup class=horiz:)%0a* Bullet list%0a* Another item%0a** More asterisks produce sub-items%0a** etc.%0a(:markupend:)%0a%0a(:markup class=horiz:)%0a# Numbered lists%0a# Another item%0a## more hashes produce sub-items%0a(:markupend:)%0a%0a(:markup class=horiz:)%0a# List types%0a# can be mixed%0a** numbered list with unordered sub-list%0a(:markupend:)%0a%0a(:if false:)%0aif someone thinks definition lists are "basic":%0a(:markup class=horiz:)%0a: Definition list : list of definitions%0a: item : the item's definition%0a: another item : that item's definition%0a:: indentation : more leading colons produce deeper lists%0a(:markupend:)%0a(:ifend:)%0a%0aLearn more about [[Text Formatting Rules#BulletedLists|lists]] (including [[Text Formatting Rules#DefinitionLists|definition lists]]) and [[list styles]].%0a%0a!![[#headings]] Headings%0aHeadings are useful for creating a "well-structured" page. They're not just for making big text.%0a%0a(:include {$FullName}#markupheaders#markupheadersend:)%0a%0a(:markup class=horiz:)%0a!! Major Subheading%0a!!! Minor Subheading%0a!!!! And More%0a!!!!! Subheadings%0a(:markupend:)%0a%0a!![[#emphasis]] Text emphasis%0aTo emphasize, enclose text in apostrophes (single-quote marks), not double-quotes.%0a%0a(:include {$FullName}#markupheaders#markupheadersend:)%0a%0a(:markup class=horiz:)%0a''Emphasize'' (italics),%0a'''strong''' (bold), %0a'''''very strong''''' (bold italics).%0a(:markupend:)%0a%0a!![[#links]] Links%0aTo make a link to another page, enclose the page's name in double square brackets.%0a%0a(:include {$FullName}#markupheaders#markupheadersend:)%0a%0a(:markup class=horiz:)%0aPractice editing in the [[wiki sandbox]]%0a(:markupend:)%0aNote that words are automatically ''capitalized'' in page titles. The link above links to the page WikiSandbox.%0a%0aText after a pipe (|) is used as the link text:%0a(:markup class=horiz:)%0aPractice editing in the%0a[[WikiSandbox | practice area]].%0a(:markupend:)%0a%0a(:comment is this still "basic" or should it be removed? :)%0aEndings become part of the link text, parentheses hide parts of the link name:%0a(:markup class=horiz:)%0a[[wiki sandbox]]es.%0a%0a[[(wiki) sandbox]].%0a(:markupend:)%0a%0aWhen linking to a page in a different [[WikiGroup]], provide the group name, followed by a separator, and then the page name:%0a(:markup class=horiz:)%0a[[Main.Wiki Sandbox]] shows group + name%0a%0a[[Main/Wiki Sandbox]] shows only name%0a(:markupend:)%0a%0aLinks to external sites%0a(:markup class=horiz:)%0abare url: https://www.pmwiki.org%0a%0alink text: [[https://www.pmwiki.org | PmWiki home]]%0a(:markupend:)%0a%0aLinks as reference to external sites%0a(:markup class=horiz:)%0abare url: https://www.pmwiki.org%0a%0alink text: [[https://www.pmwiki.org | #]]%0a(:markupend:)%0a%0aTo add a tooltip title to a link, add it in quotes after the page name or the URL:%0a(:markup:)%0aHover your mouse cursor over the links to see the tooltip.%0a* [[Documentation Index"Return to our help center"]]%0a* [[https://www.pmwiki.org"Collaborative Wiki-based CMS" | PmWiki]]%0a(:markupend:)%0a%0a(:comment is this still "basic" or should it be removed? :)%0aColons make [[InterMap]] (also called InterWiki) links to other wikis:%0a(:markup class=horiz:)%0aWhat's an [[Wikipedia:aardvark]], anyway?%0a(:markupend:)%0a%0aLinks to [[nonexistent pages]] are displayed specially, to invite others to create the page.%0a%0aPmWiki supports more link types and a lot of display options, see [[Links]] to learn more.%0a%0a!! Escape sequence [[#escape]]%0aIf you don't want Wiki markup to be processed, but lines reformatted use %25pmhlt%25[@[= =]@]. Can also be used inline.%0a(:markup class=horiz:)%0a[=%0amarkup is ''not'' processed%0abut lines are reformatted%0a=]%0a(:markupend:)%0a%0a!!Preformatted text [[#preformatted]]%0aPreformatted text is displayed using a monospace font and not generating linebreaks except where explicitly indicated in the markup.%0a%0aNote that very long lines of preformatted text can cause the whole page to be wide.%0a%0aFor preformatted text with markup (e.g. emphasis) being processed, start each line with a space:%0a(:markup class=horiz:)%0a Lines that begin with a space%0a are formatted exactly as typed%0a in a '''fixed-width''' font.%0a(:markupend:)%0a%0aIf you don't want Wiki markup to be processed, use %25pmhlt%25@@[=[@ @]=]@@. Can also be used inline.%0a(:markup class=horiz:)%0a[@%0aText escaped this way has%0athe HTML ''code'' style%0a@]%0a(:markupend:)%0a%0aYou can also use the [[#escape|escape sequence]] preceded with a space on the first line.%0a(:markup class=horiz:)%0a [=The '''escape sequence''',%0apreceded by space(s) on the first line,%0ais rendered preformatted.=]%0a(:markupend:)%0a%0aYou can enable [[WikiStyles#highlight|code highlighting]] for preformatted blocks with recent PmWiki versions.%0a%0a!! Horizontal line%0a(:markup class=horiz:)%0aFour or more dashes at%0athe beginning of a line%0a----%0aproduce a "horizontal rule"%0a(:markupend:)%0a%0a!! Tables%0aSimple tables use double pipe characters to separate cells:%0a(:markup class=horiz:)%0a|| border=1%0a||! head 1 ||! head 2 ||! head 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0aSee [[Tables|simple tables]] and [[Table Directives|advanced tables]] to learn more about the rich feature set of PmWiki tables.%0a%0a!! Images%0aSee [[Images]]%0a%0a%0a!! Character formatting%0a%0a(:include {$FullName}#markupheaders#markupheadersend:)%0a%0a(:markup class=horiz:)%0a* @@Monospaced text@@%0a* Text with '^superscripts^'%0a* Text with '_subscripts_'%0a* deleted {-strikethrough-} text%0a* inserted {+underline+} text%0a* [+big+], [++bigger++] text%0a* [-small-], [--smaller--] text%0a(:markupend:)%0a%0aUse [[WikiStyles]] to change %25red%25 the %25blue%25 text %25green%25 %25color=#ff7f00%25 color %25%25.%0a%0a[[#pagetitles]]%0a!! Page titles%0aThe %25pmhlt%25[@(:title:)@] directive sets the page's title to something other than its page name.%0a(:markup class=horiz:)%0a(:Title Basic PmWiki editing rules:)%0aThe name of this page is "{$Name}", and its title is "{$Title}".%0a(:markupend:)%0a%0a[[#pagedesc]]%0a!! Page description%0a* The %25pmhlt%25[@(:Description Page description here:)@] directive sets the page description. The description is used by search engines, and can be displayed in search results and in [[page lists]].%0a(:markup class=horiz:)%0a(:Description PmWiki's basic editing rules:)%0aThe summary description of this page is "{$Description}".%0a(:markupend:)%0a%0a[[#pagesummary]]%0a!! Page summary%0a* %25pmhlt%25@@[=(:=]Summary:Page summary here:)@@ is a [[PageTextVariable(s)]] that is used in some of the default [[PageList templates]].%0a(:markup class=horiz:)%0a(:Summary:PmWiki's basic edit syntax:)%0aThe summary of this page is "{$:Summary}".%0a(:markupend:)%0a%0a%0a%0a>>faq%3c%3c [[#faq]]%0a[[#beginning]]%0aQ: I'm new to PmWiki, where can I find some basic help for getting started?%0aA: The [[Basic Editing]] page is a good start. From there, you can just follow the navigational links at the top or the bottom of the page (they are called [[Wiki Trails]]) to the next pages, or to the [[Documentation Index]] page, which provides an outline style index of essential documentation pages, organized from basic to advanced.%0a%0aQ: How do I include special characters such as Copyright (©) and Trademark (® or ™) on my wiki pages?%0aA: See [[special characters]] on how to insert special characters that don't appear on your keyboard.%0a%0aQ: How can I preserve line-breaks from the source text?%0aA: PmWiki normally treats consecutive lines of text as being a paragraph, and merges and wraps lines together on output. This is consistent with most other wiki packages. An author can use the %25pmhlt%25[@(:linebreaks:)@] directive to cause the following lines of markup text in the page to be kept as separate lines in the output. Or a wiki administrator can set in ''config.php'' %25hlt php%25@@$EnablePreserveLineBreaks = 1;@@ to enable line breaks by default.%0a%0aQ: Can I just enter HTML directly?%0aA: By default (and by design), PmWiki does not support the use of HTML elements in the editable markup for wiki pages. There are a number of reasons for this described in the [[PmWiki Philosophy]] and [[Audiences]]. Enabling HTML markup within wiki pages in a collaborative environment may exclude some potential authors from being able to edit pages, and pose a number of display and security issues. However, a site administrator can use the [[Cookbook:Enable HTML]] recipe to enable the use of HTML markup directly in pages.%0a%0aQ: Where can I find more documentation?%0aA: See the [[Documentation Index | documentation index]] and the [[markup master index]] pages. +time=1724041073 title=Basic PmWiki editing rules diff --git a/wikilib.d/PmWiki.BasicVariables b/wikilib.d/PmWiki.BasicVariables index 33558424..d81817c7 100644 --- a/wikilib.d/PmWiki.BasicVariables +++ b/wikilib.d/PmWiki.BasicVariables @@ -1,9 +1,9 @@ -version=pmwiki-2.3.18 ordered=1 urlencoded=1 +version=pmwiki-2.3.36 ordered=1 urlencoded=1 author=Petko charset=UTF-8 -csum=not "page variable". To see PHP variables go to ?action=diag (-19) (-12) +csum=$EnableCommonEnhancements (-2) name=PmWiki.BasicVariables -rev=121 -targets=PmWiki.Variables,PmWiki.BasicVariables,PmWiki.AuthoringPhilosophy,PmWiki.EditVariables,PmWiki.AuthUser,PmWiki.Categories,PmWiki.WikiFarms,PmWiki.WikiGroup,PmWiki.GroupCustomizations,PmWiki.LocalCustomizations,PmWiki.LinkVariables,PmWiki.WikiWord,PmWiki.MarkupExpressions,Cookbook.LimitWikiGroups,Site.Search,Site.EditForm,Site.PageNotFound,SiteAdmin.AuthList,SiteAdmin.AuthUser,SiteAdmin.ApprovedUrls,PmWiki.Skins,PmWiki.LayoutVariables,PmWiki.Functions,PmWiki.PageVariables,Category.PmWikiDeveloper,!PmWikiDeveloper -text=(:Summary: core variables:)%0a%0aWhere the [[variables]] are available as wiki markup they are shown as ''Variable value'' "%25pmhlt%25[@{$VariableName}@]".%0a%0a:$AsSpacedFunction:The name of the function used to convert WikiWords into normal, spaced strings. Defaults to '@@AsSpaced@@'.%0a: :%25hlt php%25[@$AsSpacedFunction = 'MyAsSpaced';@]%0a%0a%25rfloat%25$Author is currently "{$Author}"%0a:$Author : Set to the current reader, who is potentially an author ([[PmWiki:AuthoringPhilosophy|see discussion]]). See also $EnablePostAuthorRequired.%0a%0a:$AuthorGroup: The WikiGroup for user profiles. Defaults to '@@Profiles@@'. This variable is implicit in the markup %25pmhlt%25[@[[~AuthorName]]@]%0a: :%25hlt php%25[@$AuthorGroup = 'Users';@]%0a%0a:$AuthId: For sites using [[AuthUser | user-based authorization]], tracks the "reader" or login name.%0a: :%25hlt php%25[@SessionAuth($pagename);@]%0a: :%25hlt php%25[@if( isset($AuthId) ) { // this person has been authenticated@]%0a%0a:$AuthPw: Request for documentation, meanwhile see [[https://www.pmwiki.org/pipermail/pmwiki-users/2006-August/030386.html|AuthId vs AuthPw]].%0a: :%25hlt php%25[@SessionAuth($pagename);@]%0a: :%25hlt php%25[@if( isset($AuthPw) ) { // this person has entered a password@] %0a%0a%25rfloat%25$BaseName is currently "{$BaseName}"%0a:$BaseName:%0a:$BaseNamePatterns:Allows population of the %25pmhlt%25[@{$BaseName}@] PageVariable. The key to the hash is the pattern to be replaced and the value is the replacement string.%0a: :%25hlt php%25[@%0a# If {$FullName} is 'Group.Page-Draft' then {$BaseName} is 'Group.Page'%0a$BaseNamePatterns['/-Draft$/'] = '';%0a# If {$FullName} is 'Comments-Group.Page' then {$BaseName} is 'Group.Page'%0a$BaseNamePatterns['/^Comments-/'] = '';@]%0a%0a:$CategoryGroup: The WikiGroup used for categories. Defaults to '@@Category@@'. (See [[Categories]]). This variable is implicit in the markup %25pmhlt%25[@[[!CategoryName]]@]%0a%0a:$CookiePrefix: A string prefix to be prepended to cookies set from PmWiki scripts. It defaults to '', but can be set to a different value to avoid conflicts with similar-named cookies from other applications, or to allow multiple wikis from the same domain to store separate cookies.%0a: :%25hlt php%25[@$CookiePrefix = 'pmwiki_'; # set cookie prefix to 'pmwiki_'@]%0a::If you have a [[WikiFarm(s)]], use the following in each field's ''@@config.php@@'' to get a unique prefix for each field in the farm, thus isolating each field's cookies.:%0a: :%25hlt php%25[@$CookiePrefix = substr($tmp = md5(__FILE__), 0, 5).'_';@]%0a%0a%25rfloat%25$DefaultGroup is currently "{$DefaultGroup}"%0a:$DefaultGroup:[[WikiGroup]] used by default (on startup) when no group is specified in the URL. %0a%0a%25rfloat%25$DefaultName is currently "{$DefaultName}"%0a:$DefaultName:Name of the default HomePage of each WikiGroup. Used when the group doesn't have a page with the same name as the group.%0a: :Note that the behavior will differ based on whether the page exists or not. Probably you want to alter $PagePathFmt in addition to $DefaultName if you really want it to take effect.%0a-> Note: See comment below under $DefaultPage re the order how this must be defined within your @@(farm)config.php@@ scripts - this must be set prior to any call of %25hlt php%25[@ResolvePageName()@].%0a%0a:$DefaultPage:Startup page when PmWiki is called without a specified page, normally ''@@$DefaultGroup.$DefaultName@@''.%0a-> Note: for @@$DefaultGroup@@, @@$DefaultName@@ and @@$DefaultPage@@ variables to work, they should be defined in the beginning of @@(farm)config.php@@, before any call to the function %25hlt php%25@@ResolvePageName()@@. This means, before any script from PmWiki and before any recipe that might be using this function. This also means it cannot be set in a per-page or per-group customization script - %25hlt php%25@@ResolvePageName()@@ is called before these are loaded.%0a: : Please note that this variable is intended to be set in @@(farm)config.php@@, not in individual groups. Trying to use different @@$DefaultName@@, @@$DefaultPage@@ or@@ $PagePathFmt@@ settings in different groups will cause cross-group linking anomalies.%0a%0a:$EnableLocalConfig:Allows/disables @@local/config.php@@ customizations (usually for a farm's wikis). Can be set to zero in @@local/farmconfig.php@@ to prevent the farm's wikis' @@local/config.php@@ from being loaded.%0a: :%25hlt php%25[@$EnableLocalConfig = 0; # disable PmWiki's local/config@]%0a%0a:$EnableStdConfig:Disables @@scripts/stdconfig.php@@ and a large part of the core functionalities provided by the scripts in the @@pmwiki/scripts@@ directory and outlined in the core documentation, unless included by your own local configuration (notably core markup rules, page history, skins, uploads). Allows you to completely reshape the way PmWiki behaves, if you need to.%0a: :%25hlt php%25[@$EnableStdConfig = 0; # disable many standard features@]%0a%0a%0a:$EnablePGCust:Allows/disables per-page and [[GroupCustomizations | per-group customizations]]. Can be set to zero in any [[local customization(s)]] file to prevent remaining page/group customizations from being loaded.%0a: :%25hlt php%25[@$EnablePGCust = 0; # turn off per-page/group configs@]%0a%0a:$EnableBaseNameConfig:When enabled, and if the page has a different base page (per $BaseNamePatterns), will include the local configuration for the base page. For example, if the page is "Group.Page-Draft", this would try to include the file @@local/Group.Page.php@@ in addition to @@local/Group.Page-Draft.php@@.%0a: :%25hlt php%25[@$EnableBaseNameConfig = 1; # include basename configuration@]%0a%0a:$EnableRedirect:When enabled (default), causes page redirects to automatically be performed by the browser. Setting $EnableRedirect to zero causes PmWiki to pause and issue a "Redirect to ''link''" message instead. This is sometimes useful when debugging recipes to be able to see the results of actions before page redirections occur. Not to be confused with $EnableRedirectQuiet.%0a%0a:$EnableWikiWords:Enable [[WikiWord]] processing.%0a%0a:$EnableWSPre:Enables a markup rule that causes lines with leading spaces to be treated as sections of preformatted text. If set to a value greater than 1, indicates the minimum number of leading spaces required for this treatment.%0a: :%25hlt php%25[@$EnableWSPre = 1; # leading spaces are preformatted text@]%0a: :%25hlt php%25[@$EnableWSPre = 0; # leading spaces are normal lines of text@]%0a: :%25hlt php%25[@$EnableWSPre = 4; # 4+ spaces are preformatted text@]%0a%0a:$FTimeFmt:Can be used to override the default date format used by the "@@ftime@@" function. The default $FTimeFmt is $TimeFmt. (See [[Markup Expressions]].)%0a%0a:$GroupPattern: The regular expression pattern used for valid [[WikiGroup]] name specifications. Defaults to allowing any group name beginning with an uppercase letter, but can be set to limit the valid group names (see Cookbook:LimitWikiGroups).%0a: :%25hlt php%25[@# limit groups to Site, SiteAdmin, PmWiki, and MyGroup@]%0a: :%25hlt php%25[@$GroupPattern = '(?:Site|SiteAdmin|PmWiki|MyGroup)';@]%0a: :%25hlt php%25[@#for case-sensitive group names, note the ?-i switch:@]%0a: :%25hlt php%25[@$GroupPattern = '(?-i:Site|SiteAdmin|PmWiki|MyGroup)';@]%0a%0a:$LinkWikiWords:If set, then bare WikiWords in a page are automatically linked to pages of the same name. Note that this value can also be affected by the %25pmhlt%25[@(:linkwikiwords:)@] and [@(:nolinkwikiwords:)@] directives.%0a: :%25hlt php%25[@$LinkWikiWords = 1; # turn on WikiWord links@]%0a: :%25hlt php%25[@$LinkWikiWords = 0; # disable WikiWord links@]%0a: :Note, this setting requires WikiWords to be enabled, see $EnableWikiWords.%0a%0a:$LogoutRedirectFmt: Identifies the page to which the visitor should be sent after an [@?action=logout@]. Defaults to the current page.%0a: :%25hlt php%25[@$LogoutRedirectFmt = 'Site.Logout'; # ?action=logout target@]%0a%0a:$LogoutCookies: An array of cookie names to be removed when [@?action=logout@] is invoked.%0a%0a:$NamePattern: The regular expression pattern used for valid page names. Defaults to allowing pages beginning with an uppercase letter or digit, followed by sequences of alphanumeric characters, hyphens, and underscores. %0a%0a:$pagename: A variable that gives the name of the current page.%0a->To access inside a Markup callback function, use%0a-->%25hlt php%25[@$pagename=$GLOBALS['MarkupToHTML']['pagename'];@]%0a->It is also accessible via%0a-->%25hlt php%25[@global $pagename;@] # if you use it inside a function%0a-->%25hlt php%25[@$pagename = ResolvePageName($pagename);@]%0a->See [[PmWiki:LocalCustomizations#configphp-group-page|+]] for more information, including when it's possible to use this variable.%0a->Once you have $pagename, page variables become accessible:%0a-->%25hlt php%25[@%0a$page = PageVar($pagename, '$FullName'); # =$pagename%0a$group = PageVar($pagename, '$Group');%0a$name = PageVar($pagename, '$Name');%0a@]%0a%0a:$PagePathFmt: An array controlling how the default group home-page name will be determined.%0a: : Please note that this variable is intended to be set in @@(farm)config.php@@, not in individual groups. Trying to use different @@$DefaultName@@, @@$DefaultPage@@ or @@$PagePathFmt@@ settings in different groups will cause cross-group linking anomalies.%0a-> Default Setting:%0a-->%25hlt php%25[@$PagePathFmt = array('{$Group}.$1','$1.$1','$1.{$DefaultName}');@]%0a-> Setting to use if you wish $DefaultName to actually be the name of your group home-pages:%0a-->%25hlt php%25[@$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}','$1.$1');@]%0a-> Do note that if the @@Groupname.Groupname@@ page does exist but @@Groupname.Defaultname@@ does not exist, then @@Groupname.Groupname@@ will still take precedence. You may remove the '@@$1.$1@@' entirely to '''require''' @@Groupname.Defaultname@@ to be the group homepage - that would look like this:%0a-->%25hlt php%25[@$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}');@]%0a%0a%25rfloat%25$SiteGroup is currently "{$SiteGroup}"%0a:$SiteGroup:Default group for storing configuration and utility pages such as [[Site.Search]], [[Site.EditForm]], [[Site.PageNotFound]], etc.%0a%0a:$SiteAdminGroup:Default group for locked administrative pages such as [[SiteAdmin.AuthList]], [[SiteAdmin.AuthUser]], [[SiteAdmin.ApprovedUrls]], etc, defaults to '@@SiteAdmin@@'.%0a%0a:$Skin:The name of the directory containing the skin (theme) files, default "pmwiki". See [[Skins]].%0a%0a:$SpaceWikiWords:If set, then WikiWords in pages are automatically spaced according to $AsSpacedFunction. Note that this value can also be affected by the %25pmhlt%25[@(:spacewikiwords:)@] and [@(:nospacewikiwords:)@] directives.%0a: :%25hlt php%25[@$SpaceWikiWords = 1; # turn on WikiWord spacing@]%0a: :%25hlt php%25[@$SpaceWikiWords = 0; # turn off WikiWord spacing@]%0a%0a:$TimeFmt: The format to use for dates and times, in [[https://www.php.net/manual/en/function.strftime.php | %25hlt php%25@@strftime()@@]] format. The default value is [@'%25B %25d, %25Y at %25I:%25M %25p'@], which gives dates of the form "September 8, 2005 at 10:57 PM". Formats $CurrentTime variable.%0a: :%25hlt php%25[@$TimeFmt = '%25B %25d, %25Y'; # dates as "September 8, 2005"@]%0a: :%25hlt php%25[@$TimeFmt = '%25Y-%25m-%25d'; # dates as "2005-09-08"@]%0a%0a%0a:$EnableFTimeNew: If set to 1, enables the new functions to format dates and times for PHP before 8.1. This allows you to preview the outputs of dates and times, for example in the page footer, in Recent Changes and page histories, or with the %25pmhlt%25[@{(ftime)}@] markup expression. See explanation at [[Functions#PSFT]]. (For PHP 8.1, strftime() is deprecated, and the new functions are enabled by default.)%0a%0a%0a%25rfloat%25$Version is currently "{$Version}"%0a:$Version: A string representing the release version of PmWiki.%0a%0a%25rfloat%25$VersionNum is currently "{$VersionNum}"%0a:$VersionNum: A number representing the release version of PmWiki,%0a with the major and minor release components padded with zeroes to%0a produce three digits. Thus, release "pmwiki-2.1.40" will have $VersionNum set to 2001040.%0a%0a The first digit is a 2, the next three digits are the major%0a release number, and the last three digits are the minor release%0a number. Beta releases use 900-999 for the minor release number.%0a Thus:%0a--> [@%0a2.1.0 2001000%0a2.1.1 2001001%0a...%0a2.1.27 2001027%0a2.2.0-beta1 2001901%0a2.2.0-beta2 2001902%0a...%0a2.2.0-beta18 2001918%0a...%0a2.2.0 2002000%0a@]%0a%0a:$WikiWordPattern: The pattern that describes a WikiWord.%0a%0a:$EnableRelativePageVars:This setting controls how [[Page variables]] in included pages are understood by PmWiki.%0a: :%25hlt php%25@@$EnableRelativePageVars = 1; # PmWiki current default@@\\%0aIn this case %25pmhlt%25@@[={$Name}=]@@ displays the name of the physical page where it written. If @@[={$Name}=]@@ is in an included page, it will display the name of the included page. (This is currently PmWiki's default.)%0a: :%25hlt php%25@@$EnableRelativePageVars = 0; # revert to previous default@@\\%0aIn this case %25pmhlt%25@@[={$Name}=]@@ displays the name of the currently browsed page. Even if @@[={$Name}=]@@ is in an included page, it will display the name of the browsed page. This was PmWiki's default in versions 2.2.8 and earlier, and changed in 2.2.9, but you can revert it back with this line in config.php.%0a: : %25pmhlt%25@@[={*$Name}=]@@ with an asterisk always displays the name of the currently browsed page, regardless of $EnableRelativePageVars.%0a%0aCategories: [[!PmWiki Developer]] -time=1674963286 +rev=126 +targets=PmWiki.Variables,PmWiki.BasicVariables,PmWiki.AuthoringPhilosophy,PmWiki.EditVariables,PmWiki.AuthUser,PmWiki.Categories,PmWiki.WikiFarms,PmWiki.WikiGroup,PmWiki.SecurityVariables,PmWiki.LinkVariables,PmWiki.LayoutVariables,PmWiki.UploadVariables,PmWiki.GroupCustomizations,PmWiki.LocalCustomizations,PmWiki.WikiWord,PmWiki.MarkupExpressions,Cookbook.LimitWikiGroups,Site.Search,Site.EditForm,Site.PageNotFound,SiteAdmin.AuthList,SiteAdmin.AuthUser,SiteAdmin.ApprovedUrls,PmWiki.Skins,PmWiki.Functions,PmWiki.PageVariables,Category.PmWikiDeveloper,!PmWikiDeveloper +text=(:Summary: core variables:)%0a%0aWhere the [[variables]] are available as wiki markup they are shown as ''Variable value'' "%25pmhlt%25[@{$VariableName}@]".%0a%0a:$AsSpacedFunction:The name of the function used to convert WikiWords into normal, spaced strings. Defaults to '@@AsSpaced@@'.%0a: :%25hlt php%25[@$AsSpacedFunction = 'MyAsSpaced';@]%0a%0a%25rfloat%25$Author is currently "{$Author}"%0a:$Author : Set to the current reader, who is potentially an author ([[PmWiki:AuthoringPhilosophy|see discussion]]). See also $EnablePostAuthorRequired.%0a%0a:$AuthorGroup: The WikiGroup for user profiles. Defaults to '@@Profiles@@'. This variable is implicit in the markup %25pmhlt%25[@[[~AuthorName]]@]%0a: :%25hlt php%25[@$AuthorGroup = 'Users';@]%0a%0a:$AuthId: For sites using [[AuthUser | user-based authorization]], tracks the "reader" or login name.%0a: :%25hlt php%25[@SessionAuth($pagename);@]%0a: :%25hlt php%25[@if( isset($AuthId) ) { // this person has been authenticated@]%0a%0a:$AuthPw: Request for documentation, meanwhile see [[https://www.pmwiki.org/pipermail/pmwiki-users/2006-August/030386.html|AuthId vs AuthPw]].%0a: :%25hlt php%25[@SessionAuth($pagename);@]%0a: :%25hlt php%25[@if( isset($AuthPw) ) { // this person has entered a password@] %0a%0a%25rfloat%25$BaseName is currently "{$BaseName}"%0a:$BaseName:%0a:$BaseNamePatterns:Allows population of the %25pmhlt%25[@{$BaseName}@] PageVariable. The key to the hash is the pattern to be replaced and the value is the replacement string.%0a: :%25hlt php%25[@%0a# If {$FullName} is 'Group.Page-Draft' then {$BaseName} is 'Group.Page'%0a$BaseNamePatterns['/-Draft$/'] = '';%0a# If {$FullName} is 'Comments-Group.Page' then {$BaseName} is 'Group.Page'%0a$BaseNamePatterns['/^Comments-/'] = '';@]%0a%0a:$CategoryGroup: The WikiGroup used for categories. Defaults to '@@Category@@'. (See [[Categories]]). This variable is implicit in the markup %25pmhlt%25[@[[!CategoryName]]@]%0a%0a:$CookiePrefix: A string prefix to be prepended to cookies set from PmWiki scripts. It defaults to '', but can be set to a different value to avoid conflicts with similar-named cookies from other applications, or to allow multiple wikis from the same domain to store separate cookies.%0a: :%25hlt php%25[@$CookiePrefix = 'pmwiki_'; # set cookie prefix to 'pmwiki_'@]%0a::If you have a [[WikiFarm(s)]], use the following in each field's ''@@config.php@@'' to get a unique prefix for each field in the farm, thus isolating each field's cookies.:%0a: :%25hlt php%25[@$CookiePrefix = substr($tmp = md5(__FILE__), 0, 5).'_';@]%0a%0a%25rfloat%25$DefaultGroup is currently "{$DefaultGroup}"%0a:$DefaultGroup:[[WikiGroup]] used by default (on startup) when no group is specified in the URL. %0a%0a%25rfloat%25$DefaultName is currently "{$DefaultName}"%0a:$DefaultName:Name of the default HomePage of each WikiGroup. Used when the group doesn't have a page with the same name as the group.%0a: :Note that the behavior will differ based on whether the page exists or not. Probably you want to alter $PagePathFmt in addition to $DefaultName if you really want it to take effect.%0a-> Note: See comment below under $DefaultPage re the order how this must be defined within your @@(farm)config.php@@ scripts - this must be set prior to any call of %25hlt php%25[@ResolvePageName()@].%0a%0a:$DefaultPage:Startup page when PmWiki is called without a specified page, normally ''@@$DefaultGroup.$DefaultName@@''.%0a-> Note: for @@$DefaultGroup@@, @@$DefaultName@@ and @@$DefaultPage@@ variables to work, they should be defined in the beginning of @@(farm)config.php@@, before any call to the function %25hlt php%25@@ResolvePageName()@@. This means, before any script from PmWiki and before any recipe that might be using this function. This also means it cannot be set in a per-page or per-group customization script - %25hlt php%25@@ResolvePageName()@@ is called before these are loaded.%0a: : Please note that this variable is intended to be set in @@(farm)config.php@@, not in individual groups. Trying to use different @@$DefaultName@@, @@$DefaultPage@@ or@@ $PagePathFmt@@ settings in different groups will cause cross-group linking anomalies.%0a%0a:$EnableCommonEnhancements:This variable enables popular core functions for easier editing and review:%0a: : %25hlt php%25 @@$EnableCommonEnhancements = 1;@@%0a: : In this case, the following configuration options are enabled, unless they are already defined or disabled in config.php (click on each variable to learn more):%0a%0a %25gray%25# Security + review changes%0a $EnableCookieHTTPOnly = 1;%0a $EnableObfuscateEmails = 1;%0a $EnableRCDiffBytes = 1;%0a $EnableLocalTimes = 3;%0a %0a %25gray%25# Editing%0a $EnablePreviewChanges = 1;%0a $EnableMergeLastMinorEdit = 12*3600; %25gray%25# 12 hours%0a $EnableListIncludedPages = 1;%0a $EnablePmSyntax = 2;%0a $EnableEditAutoText = 1;%0a $EnableGUIButtons = 1;%0a $EnableGuiEditFixUrl = 220; %25gray%25# after external link button%0a%0a %25gray%25# Documentation%0a $PmTOC['Enable'] = 1; $PmTOC['EnableBacklinks'] = 1;%0a $EnableCopyCode = 1;%0a %0a %25gray%25# Uploads (if enabled)%0a $EnableUploadDrop = 1;%0a $EnableRecentUploads = 1;%0a $EnableUploadVersions = 1;%0a%0a%0a:$EnableLocalConfig:Allows/disables @@local/config.php@@ customizations (usually for a farm's wikis). Can be set to zero in @@local/farmconfig.php@@ to prevent the farm's wikis' @@local/config.php@@ from being loaded.%0a: :%25hlt php%25[@$EnableLocalConfig = 0; # disable PmWiki's local/config@]%0a%0a:$EnableStdConfig:Disables @@scripts/stdconfig.php@@ and a large part of the core functionalities provided by the scripts in the @@pmwiki/scripts@@ directory and outlined in the core documentation, unless included by your own local configuration (notably core markup rules, page history, skins, uploads). Allows you to completely reshape the way PmWiki behaves, if you need to.%0a: :%25hlt php%25[@$EnableStdConfig = 0; # disable many standard features@]%0a%0a%0a:$EnablePGCust:Allows/disables per-page and [[GroupCustomizations | per-group customizations]]. Can be set to zero in any [[local customization(s)]] file to prevent remaining page/group customizations from being loaded.%0a: :%25hlt php%25[@$EnablePGCust = 0; # turn off per-page/group configs@]%0a%0a:$EnableBaseNameConfig:When enabled, and if the page has a different base page (per $BaseNamePatterns), will include the local configuration for the base page. For example, if the page is "Group.Page-Draft", this would try to include the file @@local/Group.Page.php@@ in addition to @@local/Group.Page-Draft.php@@.%0a: :%25hlt php%25[@$EnableBaseNameConfig = 1; # include basename configuration@]%0a%0a:$EnableRedirect:When enabled (default), causes page redirects to automatically be performed by the browser. Setting $EnableRedirect to zero causes PmWiki to pause and issue a "Redirect to ''link''" message instead. This is sometimes useful when debugging recipes to be able to see the results of actions before page redirections occur. Not to be confused with $EnableRedirectQuiet.%0a%0a:$EnableWikiWords:Enable [[WikiWord]] processing.%0a%0a:$EnableWSPre:Enables a markup rule that causes lines with leading spaces to be treated as sections of preformatted text. If set to a value greater than 1, indicates the minimum number of leading spaces required for this treatment.%0a: :%25hlt php%25[@$EnableWSPre = 1; # leading spaces are preformatted text@]%0a: :%25hlt php%25[@$EnableWSPre = 0; # leading spaces are normal lines of text@]%0a: :%25hlt php%25[@$EnableWSPre = 4; # 4+ spaces are preformatted text@]%0a%0a:$FTimeFmt:Can be used to override the default date format used by the "@@ftime@@" function. The default $FTimeFmt is $TimeFmt. (See [[Markup Expressions]].)%0a%0a:$GroupPattern: The regular expression pattern used for valid [[WikiGroup]] name specifications. Defaults to allowing any group name beginning with an uppercase letter, but can be set to limit the valid group names (see Cookbook:LimitWikiGroups).%0a: :%25hlt php%25[@# limit groups to Site, SiteAdmin, PmWiki, and MyGroup@]%0a: :%25hlt php%25[@$GroupPattern = '(?:Site|SiteAdmin|PmWiki|MyGroup)';@]%0a: :%25hlt php%25[@#for case-sensitive group names, note the ?-i switch:@]%0a: :%25hlt php%25[@$GroupPattern = '(?-i:Site|SiteAdmin|PmWiki|MyGroup)';@]%0a%0a:$LinkWikiWords:If set, then bare WikiWords in a page are automatically linked to pages of the same name. Note that this value can also be affected by the %25pmhlt%25[@(:linkwikiwords:)@] and [@(:nolinkwikiwords:)@] directives.%0a: :%25hlt php%25[@$LinkWikiWords = 1; # turn on WikiWord links@]%0a: :%25hlt php%25[@$LinkWikiWords = 0; # disable WikiWord links@]%0a: :Note, this setting requires WikiWords to be enabled, see $EnableWikiWords.%0a%0a:$LogoutRedirectFmt: Identifies the page to which the visitor should be sent after an [@?action=logout@]. Defaults to the current page.%0a: :%25hlt php%25[@$LogoutRedirectFmt = 'Site.Logout'; # ?action=logout target@]%0a%0a:$LogoutCookies: An array of cookie names to be removed when [@?action=logout@] is invoked.%0a%0a:$NamePattern: The regular expression pattern used for valid page names. Defaults to allowing pages beginning with an uppercase letter or digit, followed by sequences of alphanumeric characters, hyphens, and underscores. %0a%0a:$pagename: A variable that gives the name of the current page.%0a->To access inside a Markup callback function, use%0a-->%25hlt php%25[@$pagename=$GLOBALS['MarkupToHTML']['pagename'];@]%0a->It is also accessible via%0a-->%25hlt php%25[@global $pagename;@] # if you use it inside a function%0a-->%25hlt php%25[@$pagename = ResolvePageName($pagename);@]%0a->See [[PmWiki:LocalCustomizations#configphp-group-page|+]] for more information, including when it's possible to use this variable.%0a->Once you have $pagename, page variables become accessible:%0a-->%25hlt php%25[@%0a$page = PageVar($pagename, '$FullName'); # =$pagename%0a$group = PageVar($pagename, '$Group');%0a$name = PageVar($pagename, '$Name');%0a@]%0a%0a:$PagePathFmt: An array controlling how the default group home-page name will be determined.%0a: : Please note that this variable is intended to be set in @@(farm)config.php@@, not in individual groups. Trying to use different @@$DefaultName@@, @@$DefaultPage@@ or @@$PagePathFmt@@ settings in different groups will cause cross-group linking anomalies.%0a-> Default Setting:%0a-->%25hlt php%25[@$PagePathFmt = array('{$Group}.$1','$1.$1','$1.{$DefaultName}');@]%0a-> Setting to use if you wish $DefaultName to actually be the name of your group home-pages:%0a-->%25hlt php%25[@$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}','$1.$1');@]%0a-> Do note that if the @@Groupname.Groupname@@ page does exist but @@Groupname.Defaultname@@ does not exist, then @@Groupname.Groupname@@ will still take precedence. You may remove the '@@$1.$1@@' entirely to '''require''' @@Groupname.Defaultname@@ to be the group homepage - that would look like this:%0a-->%25hlt php%25[@$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}');@]%0a%0a%25rfloat%25$SiteGroup is currently "{$SiteGroup}"%0a:$SiteGroup:Default group for storing configuration and utility pages such as [[Site.Search]], [[Site.EditForm]], [[Site.PageNotFound]], etc.%0a%0a:$SiteAdminGroup:Default group for locked administrative pages such as [[SiteAdmin.AuthList]], [[SiteAdmin.AuthUser]], [[SiteAdmin.ApprovedUrls]], etc, defaults to '@@SiteAdmin@@'.%0a%0a:$Skin:The name of the directory containing the skin (theme) files, default "pmwiki". See [[Skins]].%0a%0a:$SpaceWikiWords:If set, then WikiWords in pages are automatically spaced according to $AsSpacedFunction. Note that this value can also be affected by the %25pmhlt%25[@(:spacewikiwords:)@] and [@(:nospacewikiwords:)@] directives.%0a: :%25hlt php%25[@$SpaceWikiWords = 1; # turn on WikiWord spacing@]%0a: :%25hlt php%25[@$SpaceWikiWords = 0; # turn off WikiWord spacing@]%0a%0a:$TimeFmt: The format to use for dates and times, in [[https://www.php.net/manual/en/function.strftime.php | %25hlt php%25@@strftime()@@]] format. The default value is [@'%25B %25d, %25Y at %25I:%25M %25p'@], which gives dates of the form "September 8, 2005 at 10:57 PM". Formats $CurrentTime variable.%0a: :%25hlt php%25[@$TimeFmt = '%25B %25d, %25Y'; # dates as "September 8, 2005"@]%0a: :%25hlt php%25[@$TimeFmt = '%25Y-%25m-%25d'; # dates as "2005-09-08"@]%0a%0a%0a:$EnableFTimeNew: If set to 1, enables the new functions to format dates and times for PHP before 8.1. This allows you to preview the outputs of dates and times, for example in the page footer, in Recent Changes and page histories, or with the %25pmhlt%25[@{(ftime)}@] markup expression. See explanation at [[Functions#PSFT]]. (For PHP 8.1, strftime() is deprecated, and the new functions are enabled by default.)%0a%0a%0a%25rfloat%25$Version is currently "{$Version}"%0a:$Version: A string representing the release version of PmWiki.%0a%0a%25rfloat%25$VersionNum is currently "{$VersionNum}"%0a:$VersionNum: A number representing the release version of PmWiki,%0a with the major and minor release components padded with zeroes to%0a produce three digits. Thus, release "pmwiki-2.1.40" will have $VersionNum set to 2001040.%0a%0a The first digit is a 2, the next three digits are the major%0a release number, and the last three digits are the minor release%0a number. Beta releases use 900-999 for the minor release number.%0a Thus:%0a--> [@%0a2.1.0 2001000%0a2.1.1 2001001%0a...%0a2.1.27 2001027%0a2.2.0-beta1 2001901%0a2.2.0-beta2 2001902%0a...%0a2.2.0-beta18 2001918%0a...%0a2.2.0 2002000%0a@]%0a%0a:$WikiWordPattern: The pattern that describes a WikiWord.%0a%0a:$EnableRelativePageVars:This setting controls how [[Page variables]] in included pages are understood by PmWiki.%0a: :%25hlt php%25@@$EnableRelativePageVars = 1; # PmWiki current default@@\\%0aIn this case %25pmhlt%25@@[={$Name}=]@@ displays the name of the physical page where it written. If @@[={$Name}=]@@ is in an included page, it will display the name of the included page. (This is currently PmWiki's default.)%0a: :%25hlt php%25@@$EnableRelativePageVars = 0; # revert to previous default@@\\%0aIn this case %25pmhlt%25@@[={$Name}=]@@ displays the name of the currently browsed page. Even if @@[={$Name}=]@@ is in an included page, it will display the name of the browsed page. This was PmWiki's default in versions 2.2.8 and earlier, and changed in 2.2.9, but you can revert it back with this line in config.php.%0a: : %25pmhlt%25@@[={*$Name}=]@@ with an asterisk always displays the name of the currently browsed page, regardless of $EnableRelativePageVars.%0a%0aCategories: [[!PmWiki Developer]] +time=1724040228 diff --git a/wikilib.d/PmWiki.ChangeLog b/wikilib.d/PmWiki.ChangeLog index 95a8f01e..fa2c3aaf 100644 --- a/wikilib.d/PmWiki.ChangeLog +++ b/wikilib.d/PmWiki.ChangeLog @@ -1,9 +1,9 @@ -version=pmwiki-2.3.35 ordered=1 urlencoded=1 +version=pmwiki-2.3.36 ordered=1 urlencoded=1 author=Petko charset=UTF-8 -csum=2.3.36 (+67) +csum=2.3.37 (+65) name=PmWiki.ChangeLog -rev=1871 -targets=Cookbook.RecentChanges,PmWiki.MailingLists,PmWiki.LayoutVariables,Cookbook.DragDropMultiUpload,PmWiki.UploadVariables,PmWiki.EditVariables,PITS.01510,PITS.01507,PITS.01502,PmWiki.OtherVariables,PITS.01499,PITS.01498,PmWiki.WikiStyles,PITS.01497,Cookbook.DarkColorScheme,PmWiki.LinkVariables,Cookbook.PmSyntax-Talk,PmWiki.Notify,PITS.01431,PITS.01495,PITS.01493,PmWiki.PagelistVariables,PITS.01494,Cookbook.FuseEdit,PmWiki.BasicVariables,PmWiki.SecurityVariables,PITS.01488,PITS.01489,Cookbook.SectionEdit,PITS.01486,PITS.01297,PITS.01485,Cookbook.EditHelp,PITS.01484,PITS.01208,PITS.01483,PITS.01480,PmWiki.PageVariables,PITS.01478,PITS.01477,Cookbook.PmSyntax,Cookbook.CustomSyntax,PITS.01418,PITS.00447,PITS.01475,PITS.00908,PITS.01095,PmWiki.ChangeLogArchive -text=(:Summary: Log of changes made to PmWiki by [[Release(Notes)]]:)\%0aSee [[Cookbook:RecentChanges | the cookbook recent changes page]] for additional updates and activity by other developers, or join the [[PmWiki (/) mailing lists]] to discuss feature development with us.%0a%0a(:Prerelease:Changes made to the [[PmWiki:Subversion | subversion pre-release]] of PmWiki. You can get \%0a[[https://www.pmwiki.org/pub/pmwiki-devel/pmwiki-latest-svn.zip|a full ZIP archive]] of the nightly version, or \%0a[[https://www.pmwiki.org/pub/pmwiki-devel/pmwiki-nightly.zip|a partial export]] with only the files changed since {$Version}.:)\%0a{$:xPrerelease}%0a%0a(:if false:)%0a(:comment PosArgs and $MessagesFmt were released in 2.3.34 but are undocumented and may change, so I'll announce about them in a future version:)%0a* Add helper function PosArgs($args, $posnames).%0a* Refactor $MessagesFmt to allow nested arrays with keys and %25pmhlt%25 [@(:messages key=a,b:)@]%25%25 that can be set from recipes.%0a[[#svn-revision-4753]]%0a(:ifend:)%0a!!! Version 2.3.36 (2024-08-07) [[#v2336]]%0a* Add $EnableUploadDrop based on Cookbook:DragDropMultiUpload.%0a* Add $TROEPatterns.%0a* Update for PHP 8 (PITS:01510)%0a* Store a history entry when a page is deleted.%0a* Update documentation.%0a%0a!!! Version 2.3.35 (2024-07-07) [[#v2335]]%0a* PmSyntax [@(:comment ...:)@] add required space; add [@(:input defaults ...:)@] (with "s"). %25item pmhlt%25%0a* Enable highlighted source with ?action=source&highlight=1.%0a* Update default sidebar, https links, PITS and Mailing lists in conditional.%0a* Remove upload extensions "svg", "svgz", "htm", "html", "css", "swf", "fla", "epub", and files with no extension. Fix mime types for "wmf", "psd".%0a* Fix page title could accidentally include raw HTML.%0a* Update documentation.%0a%0a!!! Version 2.3.34 (2024-05-27) [[#v2334]]%0a* Delete wikilib.d/PmWiki.PerGroupCustomizations (unused redirect), content moved to GroupCustomizations 14 years ago.%0a* RecipeCheck remove table width attribute (suggested by Simon).%0a* Add %25pmhlt%25[@(:if action browse,edit:)@] conditional.%0a* $GUIButtons remove invalid elements (warning reported by Simon).%0a* phpdiff.php fix for PHP 8 when saving new pages (reported by Simon).%0a* Responsive skin: remove old CSS declarations like @-moz-keyframes (PITS:01507).%0a* Add upload extension 'm4a'.%0a* Update documentation.%0a%0a!!! Version 2.3.33 (2024-04-21) [[#v2333]]%0a* $EnablePreviewChanges to show "%25diffadd%25No changes%25%25" if there are no changes.%0a* PmSyntax add rules for colored pagenames and URLs inside bracket links.%0a* Responsive skin hide dropdown icons from printing.%0a* Fix some cases with conditional markup and markup expressions where an empty code could be evaluated (suggested by Goodguy00).%0a* Add $HTMLTitleFmt (PITS:01502).%0a* Cache auth conditional results for %25pmhlt%25[@(:if auth level:)@].%0a* Update blocklist.php for PHP 8, reported by Foster Schucker.%0a* Update documentation.%0a%0a!!! Version 2.3.32 (2024-03-24) [[#v2332]]%0a* Dark theme: add toggleImages(), add $ImgDarkSuffix, $FmtV['$PathUpload']. Restore light styles and pictures for printing.%0a* Responsive skin: white background when printing, move dark toggle label styles into skin.css.%0a* PmSyntax: only apply dark theme colors on screen (not print).%0a* Add upload extensions and image extension patterns AVIF, AVIFS.%0a* Lock AllRecentChanges in case of concurrent uploads.%0a* FileSizeCompact() allow for base 1000 (PITS:01499).%0a* Update documentation.%0a%0a!!! Version 2.3.31 (2024-02-23) [[#v2331]]%0a* Add $EnableDarkThemeToggle, enable 3-way theme toggle, "Light", "Dark" and "Auto", add annotation tooltip showing the current theme on tap and on mouse over.%0a* Refactor config data passed to pmwiki-utils.php, refactor dark toggle functions into a separate script. %0a* Responsive skin add body attributes for group and page name, update dark theme, enable auto theme (browser preferences) by default.%0a* PmSyntax improve dark theme thanks to a script by Said Achmiz; expose color properties for reuse.%0a* Refactor redirect quiet (PITS:01498).%0a* Page attributes passwords form: allow for +addition and -removal of passwords, users, groups.%0a* Allow $EditTemplatesFmt entries to apply to specific pages with name= specification (suggested by Simon).%0a* Forms add attribute "form".%0a* Refactor $PostConfig to allow called functions to update it.%0a* Update RecipeCheck to also list skins, suggested by Simon.%0a* Refactor PrintFmt, add $EnablePrePrintFmt.%0a* [[WikiStyles]] add 'columns'.%0a* When Highlight.js is enabled, Vardoc links will be the same color as variables in highlighted code blocks.%0a* Refactor $EnableUploadVersions.%0a* Update documentation.%0a%0a!!! Version 2.3.30 (2024-01-22) [[#v2330]]%0a* Add prototype for dark theme toggle. See PITS:01497 and Cookbook:DarkColorScheme.%0a** PmWiki-responsive skin converted CSS colors to variables, added dark theme styles.%0a** Add skins/pmwiki/pmwiki-32.svg, enable default for $PageLogoUrl.%0a** PmSyntax added dark theme styles.%0a* $EnableUploadMimeMatch with Fileinfo not enabled to deny uploads.%0a* upload.php fix warning for PHP 8.%0a* RecipeCheck use https, suggested by Simon.%0a* PrintDiff() add $since argument.%0a* Add $EnableRedirectQuiet = 2. Prevent infinite redirect loops.%0a* Fix Attach: links with escaped path and filename.%0a* Improved readability for inline diffs in page history.%0a* Forms enable input e_author not only for action=edit, fix unquoted positional form action URL.%0a* Update documentation.%0a%0a!!! Version 2.3.29 (2023-12-18) [[#v2329]]%0a* Fix urlapprove.php for PHP 8.2. %0a* PmSyntax textarea remove styles for width, height (Cookbook:PmSyntax-Talk), allow for fractional dimensions of the highlighted area.%0a* $MarkupDirectiveFunctions allow dashes in attribute names.%0a* Update documentation.%0a%0a!!! Version 2.3.28 (2023-11-27) [[#v2328]]%0a* Add input ''month'' and ''color'' fields.%0a* Add $NotifyRelatedTrailFmt.%0a* Reverse simpletable row backgrounds when there is a thead element.%0a* Fix pmwiki-utils.js when window.localStorage is disabled.%0a* UrlApprovals allow https: URLs if the http: URL for the same domain has been approved (PITS:01431).%0a* Update documentation.%0a%0a!!! Version 2.3.27 (2023-10-23) [[#v2327]]%0a* When merging last edit, if there is no change summary, reuse the last one. %0a* Keep unknown date/time formats for undefined timezone (PITS:01495).%0a* DiffRenderSource() fix for PHP 8, keep ins/del tags on the same line.%0a* The ".diffmarkup" element now has the style "white-space: pre-wrap".%0a* Add new keyword shortcuts Ctrl+B (bold), Ctrl+I (italic), Ctrl+K (link/unlink).%0a* Update documentation.%0a%0a%0a!!! Version 2.3.26 (2023-09-28) [[#v2326]]%0a* Add configurable $InputLabelFmt snippet (PITS:01493).%0a* Add configurable $TrailFmt snippets.%0a* Add $EnableSearchAtLeastOneTerm, default disabled.%0a* Unset upload extensions if size for the extension is set to 0.%0a* Update feeds.php for PHP 8.2 (PITS:01494).%0a* Update documentation.%0a%0a%0a!!! Version 2.3.25 (2023-07-29) [[#v2325]]%0a* Updates for PHP 8.2.%0a* Fix pagelist when 2+ directives on the same line, reported by Simon.%0a* Fix possible bug with internal group(header|footer) directives caused by PRR().%0a* Update documentation.%0a%0a%0a!!! Version 2.3.24 (2023-06-06) [[#v2324]]%0a* Add $EnableUploadMimeMatch.%0a* Add $EnableMergeLastMinorEdit, edit functions MergeLastMinorEdit (based on Cookbook:FuseEdit), SaveChangeSummary (refactored out of HandleEdit).%0a* Fix LogoutCookies() doesn't use a $pagename argument.%0a* PmForm add condition 'validemail' for use in template require.%0a* Add $PmCryptAlgo, pmcrypt() to call password_verify() if it exists. %0a* Refactor HandleDownload() split ServeDownload($filepath, $upname).%0a* Add InsertEditFunction($newfn, $where='%3cPostPage').%0a* Add $AuthFormRespCode.%0a* Add $EnableDownloadRanges, default 1.%0a* When the token is expired, reopen edit form rather than abort.%0a* LocalTimes add $EnableRCListLastEdit.%0a* Update documentation.%0a%0a!!! Version 2.3.23 (2023-05-03) [[#v2323]]%0a* Refactor pmtoken() to use session tokens, enable for core actions.%0a* Add %25pmhlt%25[@(:input pmtoken:)@] helper.%0a* PmForm add $PmFormEnablePmToken.%0a* Refactor @@HandleLogoutA()@@ split @@LogoutCookies()@@. %0a* Fix PRCB() for PHP %3c 7.4.%0a* Update documentation.%0a%0a!!! Version 2.3.22 (2023-04-06) [[#v2322]]%0a* Add scripts/pmform.php, Site.PmFormTemplates.%0a* FmtDateTimeZ() can now accept Unix timestamps.%0a* Pagelists fix bug with multiple category=+A,+B entries.%0a* Update for PHP 8.1 (PITS:01488).%0a* MarkupDirectiveFunctions will now cast numeric arguments to floats.%0a* Prevent errors in custom PageVariables from generating internal server errors (PITS:01489).%0a* Improve inline diff for rare cases (end of page).%0a* Forms/buttons with @@data-pmconfirm="Question"@@ will ask the question before they are submitted.%0a* Update documentation.%0a%0a%0a!!! Version 2.3.21 (2023-03-06) [[#v2321]]%0a* Add $IsPmArchive, $PmArchiveDir.%0a* Sortable tables with %3ctime datetime=""> elements can be sorted by the datetime attribute. Fix for tables with preexisting %3cthead> element.%0a* Updates for PHP8.%0a* Add CSV upload extension.%0a* LocalTimes add mode=3 to show old dates as MM'YY.%0a* Fix bug with multiline $MarkupDirectiveFunctions, reported by Antti Tikanmäki.%0a* Add $EnableCopyCode and Copy code button to %3cpre> blocks, suggested by Alex Doré.%0a* Update PmTOC to work better with Cookbook:SectionEdit.%0a* Update documentation.%0a%0a!!! Version 2.3.20 (2023-02-12) [[#v2320]]%0a* Fix undefined variable warning, reported by Gregor Klarič.%0a%0a!!! Version 2.3.19 (2023-02-11) [[#v2319]]%0a* Only set cookie params if headers not sent. %0a* Update for PHP8.2, reported by Dfaure. PageVar() update for PHP 8.%0a* Add variable $DiffPrepareInlineFunction.%0a* PageListCache() remove unused global $PageIndexFile.%0a* Add configurable $LocalCSSDir, $LocalCSSDirUrl.%0a* DownloadUrl() add $FmtV['$LinkDownload'] with current or future download link.%0a* Add pm_recode() helper function (based on PageStore::recodefn), check for more transcode options.%0a* HandleBrowse() add $FmtV['$PageSourceText'].%0a* Add helper function KeepBlock().%0a* Add $FarmPubDirPrefix, pm_servefile(), $ServeFileExts.%0a* Update documentation.%0a%0a!!! Version 2.3.18 (2023-01-15) [[#v2318]]%0a* Refactor scripts/utils.php, add pm_json_encode() (PITS:01486).%0a* EditAutoText() fix for lines ending with multiple backslashes.%0a* PmSyntax optimize/refactor for large pages (cont.), fix inline escaped texts could ignore line markups, add EnableStopwatch.%0a* Notify fix typo in regular expression.%0a* {-Add $EnableUploadVersions >=10 to rename base.ext to base-1.ext, base-2.ext,...-} ''Redesigned in 2.3.31''%0a* CondAuth() fix bug with global $AuthList.%0a* Add helper function PRCB() for simpler preg_replace_callback passing variables.%0a* Update scripts/refcount.php for PHP 8, reported by George Murray.%0a* Add PageVariable $PageLogoUrl (PITS:01297).%0a* Update documentation.%0a%0a!!! Version 2.3.17 (2022-12-17) [[#v2317]]%0a* WikiStyles trim class names (PITS:01485).%0a* GUIEditButtons refactor to enable Undo in textarea; allow for custom functions to configure mopen, mclose, and unselect for their buttons.%0a* [[Cookbook:EditHelp|EditHelp]] refactor to allow undo; add shortcuts Ctrl+L convert selection to lowercase, Ctrl+Shift+L to uppercase, Ctrl+Shift+ArrowUp and ArrowDown to swap lines.%0a* Skip upgrade check if $EnableReadOnly.%0a* Fix bug with multiple $MarkupDirectiveFunctions.%0a* Add $EnableBaseNameConfig.%0a* PmSyntax optimize for larger pages (cont.).%0a* Input password add class "inputbox" like the other fields.%0a* CondAuth() added way to check for usergroup permissions.%0a* Update in pagelist.php for PHP 8.%0a* Documentation update.%0a%0a!!! Version 2.3.16 (2022-11-28) [[#v2316]]%0a* Class PPRC add generic callbacks.%0a* IncludeText() update for PHP 8, reported by V.Krishn.%0a* WikiStyle add 'overflow', 'notoc'.%0a* Add PmNonce().%0a* PmTOC update indented link style->classname. %0a* Responsive skin: replace %25pmhlt%25[@[[%3c%3c]]@] with %25hlt html%25[@%3cbr class='clearboth' />@], update PmTOC styles.%0a* $EnableListIncludedPages use class name instead of style. %0a* guiedit.js remove unneeded style.%0a* PmSyntax realign font for nested programming languages in the edit form, optimize for large pages.%0a* Only call session_status() if function exists.%0a* Edit form remove unsafe-inline script.%0a* Revert WikiStyleToClassName(), PrePrintFmt() -- need more work (PITS:01484).%0a* Documentation update.%0a%0a!!! Version 2.3.15 (2022-11-21) [[#v2315]]%0a* CSS pre, code relative/scalable font-size (pmwiki-responsive skin).%0a* PmSyntax add variable --pmsyntax-fontsize-editform and split from --pmsyntax-fontsize [[https://www.pmichaud.com/pipermail/pmwiki-users/2022-November/064936.html|#]].%0a* PmSyntax fix [@[[Highlight]]@] label font size and family (reported by Hans).%0a* Add variable $CookieSameSite default to 'Lax'%0a* Add argument $samesite to pmsetcookie(), default to $CookieSameSite, refactor for old and new PHP versions. %0a* Add function pm_session_start() respecting local configuration.%0a* CSP header add base-uri=self; object-src 'none'.%0a* Add $HTTPHeaders['XSSP'] = 'X-XSS-Protection: 1; mode=block'.%0a* Rewrite GUIButtons logic to avoid unsafe-inline JavaScript.%0a* Refactor WikiStyles, replace inline styles with class names to avoid unsafe-inline CSS.%0a* Refactor PQA(), tables, cells, to replace inline style="..." with class names to avoid unsafe-inline CSS.%0a* Add PrePrintFmt(), refactor PrintFmt(), PrintSkin() to process wiki pages, skin parts, and skin functions to HTML before outputting headers.%0a* Fix XSS vulnerability.%0a* Documentation update.%0a%0a!!! Version 2.3.14 (2022-11-03) [[#v2314]]%0a* Searchbox also escape custom field names.%0a* Prevent double-encoded entities in searchbox (reported by Simon).%0a* Trim $Author (PITS:01208).%0a* Replace autofocus inline JavaScript with attributes.%0a* Edit form: the label next to the "Minor edit" checkbox now toggles the checkbox.%0a* PmSyntax recognize %25pmhlt%25[@(:template requires? ...:)@].%0a* Update for PHP 8. %0a* Obsolete PCCF() from PHP 7.2 not 8.0.%0a* Add array $ObsoleteMarkups, function TraceMarkup(), update Markup(), Markup_e() and ObsoleteMarkup(), to retrieve and show files and line numbers for obsolete/disabled markup rules.%0a* Fix bug with PSFT format %25L.%0a* Update documentation.%0a%0a!!! Version 2.3.13 (2022-10-07) [[#v2313]]%0a* Close potential XSS vulnerability, reported by lukystreik (PITS:01483).%0a* Refactor $MultiFactorAuthFunction, add $FailedLoginsFunction.%0a* Update documentation.%0a%0a!!! Version 2.3.12 (2022-09-25) [[#v2312]]%0a* Stripmagic() cast null to "" and other fixes for PHP 8.%0a* Fix parse error for complex conditionals with empty variables (PITS:01480).%0a* PSFT() and MarkupExpression [@ftime@] add %25L as human readable local timestamp. %0a* MarkupRestore() fix wrong cast to empty string of false-ish values.%0a* PrintAuthForm() split from PmWikiAuth(). %0a* Fix warning for unneeded session_regenerate_id() (reported by George Murray).%0a* Update documentation.%0a%0a!!! Version 2.3.11 (2022-08-30) [[#v2311]]%0a* Add [[PageVariables]] %25pmhlt%25 [@{$GroupHomePage}@], [@{$GroupHomePageName}@], [@{$GroupHomePageTitle}@], [@{$GroupHomePageTitlespaced}@].%0a* Add $MarkupDirectiveFunctions.%0a* Fix stripmagic() for arrays recently broke after PHP8 update.%0a* Update documentation.%0a%0a!!! Version 2.3.10 (2022-08-20) [[#v2310]]%0a* Update for PHP 8.1 (reported by Armin Bühler).%0a* Forms will now prefill wildcard variables from $DefaultUnsetPageTextVars or $DefaultEmptyPageTextVars.%0a* $EnablePmSyntax = 3; will enable syntax highlighting in the edit form by default, without the user clicking on "Highlight". Fix occasional text mis-alignment between the text area and the highlighted block.%0a* Update documentation.%0a%0a!!! Version 2.3.9 (2022-08-18) [[#v239]]%0a* Add non-wildcard $DefaultUnsetPageTextVars to %25pmhlt%25[@(:input default:)@] (reported by Johnny).%0a* PmSyntax handles new selectors pre.pmhlt, code.pmhlt.%0a* Update for PHP 8 (PITS:01478).%0a* Update documentation.%0a%0a%0a!!! Version 2.3.8 (2022-07-22) [[#v238]]%0a* PmSyntax fix for 2 different %25pmhlt%25 [@%25hlt%25@] on the same line (reported by Simon).%0a* Fix broken include when the first page doesn't exist.%0a* Update documentation.%0a%0a!!! Version 2.3.7 (2022-06-28) [[#v237]]%0a* $HTTPHeaders add X-Frame-Options (suggested by Imagine Dragon) and Content-Security-Policy to disallow embedding in external websites by default.%0a* $EnableHighlight will now remember any links to PmWiki variables and restore them after the highlighting, see [[thread->https://www.pmwiki.org/pipermail/pmwiki-users/2022-June/064887.html]].%0a* $EnablePmSyntax will now process %25pmhlt%25[@%25hlt pmwiki%25@] in addition to [@%25pmhlt%25@] blocks, and escaped markup after it will be tentatively highlighted.%0a* Update documentation.%0a%0a!!! Version 2.3.6 (2022-06-19) [[#v236]]%0a* Fixes for PHP 8.%0a* Add form attribute "lang".%0a* Sortable tables allow for table headers to have markup such as bold (except links). It will now use a case-insensitive natural ordering.%0a* Allow for $UploadVerifyFunction to modify $upname.%0a* Add variable $PageIndexTermsFunction.%0a* Searchbox allow for removal of submit button if [@label=""@]; add default [@placeholder="$[Search]"@].%0a* Fix author.php may be included before some variables are defined, reported by Said Achmiz.%0a* $EnableHighlight convert code blocks to plain text, see [[thread->https://www.pmwiki.org/pipermail/pmwiki-users/2022-June/064887.html]].%0a* Documentation update.%0a%0a%0a!!! Version 2.3.5 (2022-05-23) [[#v235]]%0a* Fix broken list=grouphomes (PITS:01477).%0a* Add DisableSkinParts() helper function for recipes.%0a* HandlePostUpload: add @@$FmtV["$filepath"]@@ and @@$FmtV["$upurl"]@@ with the file path and direct URL to the newly uploaded file.%0a* In pmwiki-utils.js, replace forgotten ''let'' with ''var'' (suggested by SteP).%0a* Update for PHP 8.1.%0a* Update documentation.%0a%0a!!! Version 2.3.4 (2022-04-22) [[#v234]]%0a* Fixes for PHP 8 warnings, reported by Siegfried Seibert.%0a* Update documentation.%0a%0a!!! Version 2.3.3 (2022-03-26) [[#v233]]%0a* Fix for PHP 8 warnings, reported by Jean-Patrick Charrey, Dominique Faure and Siegfried Seibert.%0a* Update README.txt and docs/ files, suggested by Simon Davis.%0a* Update documentation.%0a%0a!!! Version 2.3.2 (2022-02-09) [[#v232]]%0a* Allow for $EnableLocalTimes to define custom duration of the pulled page history.%0a* Rename variable $EnableIncludedPages to $EnableListIncludedPages (avoid ambiguity).%0a* Remove $LinkAlt when an embedded picture without an alternative text fails to load.%0a* PmSyntax:%0a** Allow for line breaks \\ inside headings, tables, list items (like the core).%0a** Parallel processing of multiple blocks.%0a* Add scripts/utils.php; move loading of pmwiki-utils.js and PmSyntax to scripts/utils.js.%0a** Add $EnablePmUtils, default enabled.%0a** Parallel processing of the pmwiki-utils.js utility functions.%0a** Move pmwiki-utils.js move to $HTMLHeaderFmt (often prevents page redraw with the TOC/PmToggle/LocalTimes).%0a* Fix bug causing invalid page name when the name is "Group.0".%0a* Fix PHP 8.1.2 warnings, reported by Jürgen Godau and Dominique Faure.%0a* LocaltTimes fix "rcnew" classes for wikis with the older format.%0a* Update documentation.%0a%0a!!! Version 2.3.1 (2022-01-15) [[#v231]]%0a%0a* Fix the release script which broke the $VersionNum variable and the [@[[#anchor]]@] markup with the PmWiki-responsive skin.%0a%0a!!! Version 2.3.0 (2022-01-15) [[#v230]]%0a* Add PmSyntax, $EnablePmSyntax, $CustomSyntax, [@{$EnabledIMap}@], see Cookbook:PmSyntax, Cookbook:CustomSyntax.%0a* [@(:markup:)@] can now have @@class=norender@@ to only show the source code without processing it.%0a* Updates for PHP 8.1, hide warnings, add PSFT() replacement for strftime() and 2 callbacks, $EnableFTimeNew, update core function calls, add [@%25o@] for the ordinal suffix of the date (PITS:01418).%0a* Notify: @@tz=@@ (timezone) per-user.%0a* PageList add category= argument (PITS:00447, PITS:01475); link= and category= now accept multiple pages, wildcards, and negations (PITS:00908).%0a* [=[[!Category]]=] links can have alternative text (PITS:01095).%0a* Simplify/optimize pmwiki-utils.js when using datasets, simplify sorting of table rows without cloning, add LocalTimes().%0a* Page history diff anchors to also have "id=" attributes in addition to "name=".%0a* Add $EnableLocalTimes (default disabled) and styles, add HandleDiffList().%0a* Add markup %25pmhlt%25[@@2022-01-09T08:35:00Z@]%25%25 output as %3ctime>; localized if $EnableLocalTimes.%0a** Add $CurrentLocalTime in the above format, used by default in $RecentChangesFmt.%0a* Add $EnableRecentUploads (only Site.AllRecentChanges, only if $RecentUploadsFmt not defined).%0a* PmTOC update CSS for properly indented subheadings.%0a* Edit form $EnableIncludedPages, add placeholders to e_changesummary and e_author. Enable $EnableNotSavedWarning, add to sample-config.php. EditHelp to behave more like a word processor, typing "Enter" twice without writing text removes the preceding bullet.%0a* Responsive skin details>summary:hover {color:navy, cursor: pointer;}.%0a* PrintDiff() add classes for the delay between edits: diffday, diffweek, diffmonth, diffyear.%0a* Add helper function @@DownloadUrl($pagename, $path)@@ moved from @@LinkUpload()@@.%0a* Add [=$[ULby]=] i18n string 'uploaded by'.%0a* Update documentation.%0a%0a!!! [[#older]] Older versions%0a[[(PmWiki:)ChangeLog Archive]] - changes prior to version 2.3.0.%0a -time=1723041928 +rev=1894 +targets=Cookbook.RecentChanges,PmWiki.MailingLists,PmWiki.LayoutVariables,Cookbook.InputStar,PmWiki.BasicVariables,PmWiki.EditVariables,PmWiki.LinkVariables,PITS.01511,PmWiki.OtherVariables,Cookbook.DragDropMultiUpload,PmWiki.UploadVariables,PITS.01510,PITS.01507,PITS.01502,PITS.01499,PITS.01498,PmWiki.WikiStyles,PITS.01497,Cookbook.DarkColorScheme,Cookbook.PmSyntax-Talk,PmWiki.Notify,PITS.01431,PITS.01495,PITS.01493,PmWiki.PagelistVariables,PITS.01494,Cookbook.FuseEdit,PmWiki.SecurityVariables,PITS.01488,PITS.01489,Cookbook.SectionEdit,PITS.01486,PITS.01297,PITS.01485,Cookbook.EditHelp,PITS.01484,PITS.01208,PITS.01483,PITS.01480,PmWiki.PageVariables,PITS.01478,PITS.01477,Cookbook.PmSyntax,Cookbook.CustomSyntax,PITS.01418,PITS.00447,PITS.01475,PITS.00908,PITS.01095,PmWiki.ChangeLogArchive +text=(:Summary: Log of changes made to PmWiki by [[Release(Notes)]]:)\%0aSee [[Cookbook:RecentChanges | the cookbook recent changes page]] for additional updates and activity by other developers, or join the [[PmWiki (/) mailing lists]] to discuss feature development with us.%0a%0a(:Prerelease:Changes made to the [[PmWiki:Subversion | subversion pre-release]] of PmWiki. You can get \%0a[[https://www.pmwiki.org/pub/pmwiki-devel/pmwiki-latest-svn.zip|a full ZIP archive]] of the nightly version, or \%0a[[https://www.pmwiki.org/pub/pmwiki-devel/pmwiki-nightly.zip|a partial export]] with only the files changed since {$Version}.:)\%0a{$:xPrerelease}%0a%0a(:comment PosArgs and $MessagesFmt were released in 2.3.34 but are undocumented and may change, so I'll announce about them in a future version:)%0a(:if false:)%0a* Add helper function PosArgs($args, $posnames).%0a* Refactor $MessagesFmt to allow nested arrays with keys and %25pmhlt%25 [@(:messages key=a,b:)@]%25%25 that can be set from recipes.%0a[[#svn-revision-4796]]%0a(:ifend:)%0a!!! Version 2.3.37 (2024-08-21) [[#v2337]]%0a* Update for PHP 8.%0a* Responsive skin: cache SkinElements pages.%0a* Add helper function PRI() "PmWiki Recursive Implode".%0a* pmwiki-utils.js add "draggable".%0a* Add PageVariable %25pmhlt%25[@{$GroupHomePageUrl}@].%0a* $EnableSortable, $EnableSimpleTableRowspan enabled by default.%0a* PmSyntax update for $EnableSimpleTableRowspan and for Cookbook:InputStar; fix line-height for some skin configurations.%0a* Add $EnableCommonEnhancements, update docs/sample-config.php, remove from sample-config.php $EnableNotSavedWarning which was enabled in 2.3.0.%0a* Add $EnableObfuscateEmails, $EnablePreserveLineBreaks.%0a* Add $EnableUrlApprove, $EnablePmForm, $EnableCreole, $EnableRefCount, $EnableFeeds (PITS:01511).%0a* %25pmhlt%25[@(:input e_minorcheckbox:)@]%25%25 to include label and title per $EnableMergeLastMinorEdit, update Site.EditForm, XLPage.%0a* Anchors remove deprecated name="" attribute.%0a* Meta Content-type moved early and configurable.%0a* Update documentation.%0a%0a!!! Version 2.3.36 (2024-08-07) [[#v2336]]%0a* Add $EnableUploadDrop based on Cookbook:DragDropMultiUpload.%0a* Add $TROEPatterns.%0a* Update for PHP 8 (PITS:01510)%0a* Store a history entry when a page is deleted.%0a* Update documentation.%0a%0a!!! Version 2.3.35 (2024-07-07) [[#v2335]]%0a* PmSyntax [@(:comment ...:)@] add required space; add [@(:input defaults ...:)@] (with "s"). %25item pmhlt%25%0a* Enable highlighted source with ?action=source&highlight=1.%0a* Update default sidebar, https links, PITS and Mailing lists in conditional.%0a* Remove upload extensions "svg", "svgz", "htm", "html", "css", "swf", "fla", "epub", and files with no extension. Fix mime types for "wmf", "psd".%0a* Fix page title could accidentally include raw HTML.%0a* Update documentation.%0a%0a!!! Version 2.3.34 (2024-05-27) [[#v2334]]%0a* Delete wikilib.d/PmWiki.PerGroupCustomizations (unused redirect), content moved to GroupCustomizations 14 years ago.%0a* RecipeCheck remove table width attribute (suggested by Simon).%0a* Add %25pmhlt%25[@(:if action browse,edit:)@] conditional.%0a* $GUIButtons remove invalid elements (warning reported by Simon).%0a* phpdiff.php fix for PHP 8 when saving new pages (reported by Simon).%0a* Responsive skin: remove old CSS declarations like @-moz-keyframes (PITS:01507).%0a* Add upload extension 'm4a'.%0a* Update documentation.%0a%0a!!! Version 2.3.33 (2024-04-21) [[#v2333]]%0a* $EnablePreviewChanges to show "%25diffadd%25No changes%25%25" if there are no changes.%0a* PmSyntax add rules for colored pagenames and URLs inside bracket links.%0a* Responsive skin hide dropdown icons from printing.%0a* Fix some cases with conditional markup and markup expressions where an empty code could be evaluated (suggested by Goodguy00).%0a* Add $HTMLTitleFmt (PITS:01502).%0a* Cache auth conditional results for %25pmhlt%25[@(:if auth level:)@].%0a* Update blocklist.php for PHP 8, reported by Foster Schucker.%0a* Update documentation.%0a%0a!!! Version 2.3.32 (2024-03-24) [[#v2332]]%0a* Dark theme: add toggleImages(), add $ImgDarkSuffix, $FmtV['$PathUpload']. Restore light styles and pictures for printing.%0a* Responsive skin: white background when printing, move dark toggle label styles into skin.css.%0a* PmSyntax: only apply dark theme colors on screen (not print).%0a* Add upload extensions and image extension patterns AVIF, AVIFS.%0a* Lock AllRecentChanges in case of concurrent uploads.%0a* FileSizeCompact() allow for base 1000 (PITS:01499).%0a* Update documentation.%0a%0a!!! Version 2.3.31 (2024-02-23) [[#v2331]]%0a* Add $EnableDarkThemeToggle, enable 3-way theme toggle, "Light", "Dark" and "Auto", add annotation tooltip showing the current theme on tap and on mouse over.%0a* Refactor config data passed to pmwiki-utils.php, refactor dark toggle functions into a separate script. %0a* Responsive skin add body attributes for group and page name, update dark theme, enable auto theme (browser preferences) by default.%0a* PmSyntax improve dark theme thanks to a script by Said Achmiz; expose color properties for reuse.%0a* Refactor redirect quiet (PITS:01498).%0a* Page attributes passwords form: allow for +addition and -removal of passwords, users, groups.%0a* Allow $EditTemplatesFmt entries to apply to specific pages with name= specification (suggested by Simon).%0a* Forms add attribute "form".%0a* Refactor $PostConfig to allow called functions to update it.%0a* Update RecipeCheck to also list skins, suggested by Simon.%0a* Refactor PrintFmt, add $EnablePrePrintFmt.%0a* [[WikiStyles]] add 'columns'.%0a* When Highlight.js is enabled, Vardoc links will be the same color as variables in highlighted code blocks.%0a* Refactor $EnableUploadVersions.%0a* Update documentation.%0a%0a!!! Version 2.3.30 (2024-01-22) [[#v2330]]%0a* Add prototype for dark theme toggle. See PITS:01497 and Cookbook:DarkColorScheme.%0a** PmWiki-responsive skin converted CSS colors to variables, added dark theme styles.%0a** Add skins/pmwiki/pmwiki-32.svg, enable default for $PageLogoUrl.%0a** PmSyntax added dark theme styles.%0a* $EnableUploadMimeMatch with Fileinfo not enabled to deny uploads.%0a* upload.php fix warning for PHP 8.%0a* RecipeCheck use https, suggested by Simon.%0a* PrintDiff() add $since argument.%0a* Add $EnableRedirectQuiet = 2. Prevent infinite redirect loops.%0a* Fix Attach: links with escaped path and filename.%0a* Improved readability for inline diffs in page history.%0a* Forms enable input e_author not only for action=edit, fix unquoted positional form action URL.%0a* Update documentation.%0a%0a!!! Version 2.3.29 (2023-12-18) [[#v2329]]%0a* Fix urlapprove.php for PHP 8.2. %0a* PmSyntax textarea remove styles for width, height (Cookbook:PmSyntax-Talk), allow for fractional dimensions of the highlighted area.%0a* $MarkupDirectiveFunctions allow dashes in attribute names.%0a* Update documentation.%0a%0a!!! Version 2.3.28 (2023-11-27) [[#v2328]]%0a* Add input ''month'' and ''color'' fields.%0a* Add $NotifyRelatedTrailFmt.%0a* Reverse simpletable row backgrounds when there is a thead element.%0a* Fix pmwiki-utils.js when window.localStorage is disabled.%0a* UrlApprovals allow https: URLs if the http: URL for the same domain has been approved (PITS:01431).%0a* Update documentation.%0a%0a!!! Version 2.3.27 (2023-10-23) [[#v2327]]%0a* When merging last edit, if there is no change summary, reuse the last one. %0a* Keep unknown date/time formats for undefined timezone (PITS:01495).%0a* DiffRenderSource() fix for PHP 8, keep ins/del tags on the same line.%0a* The ".diffmarkup" element now has the style "white-space: pre-wrap".%0a* Add new keyword shortcuts Ctrl+B (bold), Ctrl+I (italic), Ctrl+K (link/unlink).%0a* Update documentation.%0a%0a%0a!!! Version 2.3.26 (2023-09-28) [[#v2326]]%0a* Add configurable $InputLabelFmt snippet (PITS:01493).%0a* Add configurable $TrailFmt snippets.%0a* Add $EnableSearchAtLeastOneTerm, default disabled.%0a* Unset upload extensions if size for the extension is set to 0.%0a* Update feeds.php for PHP 8.2 (PITS:01494).%0a* Update documentation.%0a%0a%0a!!! Version 2.3.25 (2023-07-29) [[#v2325]]%0a* Updates for PHP 8.2.%0a* Fix pagelist when 2+ directives on the same line, reported by Simon.%0a* Fix possible bug with internal group(header|footer) directives caused by PRR().%0a* Update documentation.%0a%0a%0a!!! Version 2.3.24 (2023-06-06) [[#v2324]]%0a* Add $EnableUploadMimeMatch.%0a* Add $EnableMergeLastMinorEdit, edit functions MergeLastMinorEdit (based on Cookbook:FuseEdit), SaveChangeSummary (refactored out of HandleEdit).%0a* Fix LogoutCookies() doesn't use a $pagename argument.%0a* PmForm add condition 'validemail' for use in template require.%0a* Add $PmCryptAlgo, pmcrypt() to call password_verify() if it exists. %0a* Refactor HandleDownload() split ServeDownload($filepath, $upname).%0a* Add InsertEditFunction($newfn, $where='%3cPostPage').%0a* Add $AuthFormRespCode.%0a* Add $EnableDownloadRanges, default 1.%0a* When the token is expired, reopen edit form rather than abort.%0a* LocalTimes add $EnableRCListLastEdit.%0a* Update documentation.%0a%0a!!! Version 2.3.23 (2023-05-03) [[#v2323]]%0a* Refactor pmtoken() to use session tokens, enable for core actions.%0a* Add %25pmhlt%25[@(:input pmtoken:)@] helper.%0a* PmForm add $PmFormEnablePmToken.%0a* Refactor @@HandleLogoutA()@@ split @@LogoutCookies()@@. %0a* Fix PRCB() for PHP %3c 7.4.%0a* Update documentation.%0a%0a!!! Version 2.3.22 (2023-04-06) [[#v2322]]%0a* Add scripts/pmform.php, Site.PmFormTemplates.%0a* FmtDateTimeZ() can now accept Unix timestamps.%0a* Pagelists fix bug with multiple category=+A,+B entries.%0a* Update for PHP 8.1 (PITS:01488).%0a* MarkupDirectiveFunctions will now cast numeric arguments to floats.%0a* Prevent errors in custom PageVariables from generating internal server errors (PITS:01489).%0a* Improve inline diff for rare cases (end of page).%0a* Forms/buttons with @@data-pmconfirm="Question"@@ will ask the question before they are submitted.%0a* Update documentation.%0a%0a%0a!!! Version 2.3.21 (2023-03-06) [[#v2321]]%0a* Add $IsPmArchive, $PmArchiveDir.%0a* Sortable tables with %3ctime datetime=""> elements can be sorted by the datetime attribute. Fix for tables with preexisting %3cthead> element.%0a* Updates for PHP8.%0a* Add CSV upload extension.%0a* LocalTimes add mode=3 to show old dates as MM'YY.%0a* Fix bug with multiline $MarkupDirectiveFunctions, reported by Antti Tikanmäki.%0a* Add $EnableCopyCode and Copy code button to %3cpre> blocks, suggested by Alex Doré.%0a* Update PmTOC to work better with Cookbook:SectionEdit.%0a* Update documentation.%0a%0a!!! Version 2.3.20 (2023-02-12) [[#v2320]]%0a* Fix undefined variable warning, reported by Gregor Klarič.%0a%0a!!! Version 2.3.19 (2023-02-11) [[#v2319]]%0a* Only set cookie params if headers not sent. %0a* Update for PHP8.2, reported by Dfaure. PageVar() update for PHP 8.%0a* Add variable $DiffPrepareInlineFunction.%0a* PageListCache() remove unused global $PageIndexFile.%0a* Add configurable $LocalCSSDir, $LocalCSSDirUrl.%0a* DownloadUrl() add $FmtV['$LinkDownload'] with current or future download link.%0a* Add pm_recode() helper function (based on PageStore::recodefn), check for more transcode options.%0a* HandleBrowse() add $FmtV['$PageSourceText'].%0a* Add helper function KeepBlock().%0a* Add $FarmPubDirPrefix, pm_servefile(), $ServeFileExts.%0a* Update documentation.%0a%0a!!! Version 2.3.18 (2023-01-15) [[#v2318]]%0a* Refactor scripts/utils.php, add pm_json_encode() (PITS:01486).%0a* EditAutoText() fix for lines ending with multiple backslashes.%0a* PmSyntax optimize/refactor for large pages (cont.), fix inline escaped texts could ignore line markups, add EnableStopwatch.%0a* Notify fix typo in regular expression.%0a* {-Add $EnableUploadVersions >=10 to rename base.ext to base-1.ext, base-2.ext,...-} ''Redesigned in 2.3.31''%0a* CondAuth() fix bug with global $AuthList.%0a* Add helper function PRCB() for simpler preg_replace_callback passing variables.%0a* Update scripts/refcount.php for PHP 8, reported by George Murray.%0a* Add PageVariable $PageLogoUrl (PITS:01297).%0a* Update documentation.%0a%0a!!! Version 2.3.17 (2022-12-17) [[#v2317]]%0a* WikiStyles trim class names (PITS:01485).%0a* GUIEditButtons refactor to enable Undo in textarea; allow for custom functions to configure mopen, mclose, and unselect for their buttons.%0a* [[Cookbook:EditHelp|EditHelp]] refactor to allow undo; add shortcuts Ctrl+L convert selection to lowercase, Ctrl+Shift+L to uppercase, Ctrl+Shift+ArrowUp and ArrowDown to swap lines.%0a* Skip upgrade check if $EnableReadOnly.%0a* Fix bug with multiple $MarkupDirectiveFunctions.%0a* Add $EnableBaseNameConfig.%0a* PmSyntax optimize for larger pages (cont.).%0a* Input password add class "inputbox" like the other fields.%0a* CondAuth() added way to check for usergroup permissions.%0a* Update in pagelist.php for PHP 8.%0a* Documentation update.%0a%0a!!! Version 2.3.16 (2022-11-28) [[#v2316]]%0a* Class PPRC add generic callbacks.%0a* IncludeText() update for PHP 8, reported by V.Krishn.%0a* WikiStyle add 'overflow', 'notoc'.%0a* Add PmNonce().%0a* PmTOC update indented link style->classname. %0a* Responsive skin: replace %25pmhlt%25[@[[%3c%3c]]@] with %25hlt html%25[@%3cbr class='clearboth' />@], update PmTOC styles.%0a* $EnableListIncludedPages use class name instead of style. %0a* guiedit.js remove unneeded style.%0a* PmSyntax realign font for nested programming languages in the edit form, optimize for large pages.%0a* Only call session_status() if function exists.%0a* Edit form remove unsafe-inline script.%0a* Revert WikiStyleToClassName(), PrePrintFmt() -- need more work (PITS:01484).%0a* Documentation update.%0a%0a!!! Version 2.3.15 (2022-11-21) [[#v2315]]%0a* CSS pre, code relative/scalable font-size (pmwiki-responsive skin).%0a* PmSyntax add variable --pmsyntax-fontsize-editform and split from --pmsyntax-fontsize [[https://www.pmichaud.com/pipermail/pmwiki-users/2022-November/064936.html|#]].%0a* PmSyntax fix [@[[Highlight]]@] label font size and family (reported by Hans).%0a* Add variable $CookieSameSite default to 'Lax'%0a* Add argument $samesite to pmsetcookie(), default to $CookieSameSite, refactor for old and new PHP versions. %0a* Add function pm_session_start() respecting local configuration.%0a* CSP header add base-uri=self; object-src 'none'.%0a* Add $HTTPHeaders['XSSP'] = 'X-XSS-Protection: 1; mode=block'.%0a* Rewrite GUIButtons logic to avoid unsafe-inline JavaScript.%0a* Refactor WikiStyles, replace inline styles with class names to avoid unsafe-inline CSS.%0a* Refactor PQA(), tables, cells, to replace inline style="..." with class names to avoid unsafe-inline CSS.%0a* Add PrePrintFmt(), refactor PrintFmt(), PrintSkin() to process wiki pages, skin parts, and skin functions to HTML before outputting headers.%0a* Fix XSS vulnerability.%0a* Documentation update.%0a%0a!!! Version 2.3.14 (2022-11-03) [[#v2314]]%0a* Searchbox also escape custom field names.%0a* Prevent double-encoded entities in searchbox (reported by Simon).%0a* Trim $Author (PITS:01208).%0a* Replace autofocus inline JavaScript with attributes.%0a* Edit form: the label next to the "Minor edit" checkbox now toggles the checkbox.%0a* PmSyntax recognize %25pmhlt%25[@(:template requires? ...:)@].%0a* Update for PHP 8. %0a* Obsolete PCCF() from PHP 7.2 not 8.0.%0a* Add array $ObsoleteMarkups, function TraceMarkup(), update Markup(), Markup_e() and ObsoleteMarkup(), to retrieve and show files and line numbers for obsolete/disabled markup rules.%0a* Fix bug with PSFT format %25L.%0a* Update documentation.%0a%0a!!! Version 2.3.13 (2022-10-07) [[#v2313]]%0a* Close potential XSS vulnerability, reported by lukystreik (PITS:01483).%0a* Refactor $MultiFactorAuthFunction, add $FailedLoginsFunction.%0a* Update documentation.%0a%0a!!! Version 2.3.12 (2022-09-25) [[#v2312]]%0a* Stripmagic() cast null to "" and other fixes for PHP 8.%0a* Fix parse error for complex conditionals with empty variables (PITS:01480).%0a* PSFT() and MarkupExpression [@ftime@] add %25L as human readable local timestamp. %0a* MarkupRestore() fix wrong cast to empty string of false-ish values.%0a* PrintAuthForm() split from PmWikiAuth(). %0a* Fix warning for unneeded session_regenerate_id() (reported by George Murray).%0a* Update documentation.%0a%0a!!! Version 2.3.11 (2022-08-30) [[#v2311]]%0a* Add [[PageVariables]] %25pmhlt%25 [@{$GroupHomePage}@], [@{$GroupHomePageName}@], [@{$GroupHomePageTitle}@], [@{$GroupHomePageTitlespaced}@].%0a* Add $MarkupDirectiveFunctions.%0a* Fix stripmagic() for arrays recently broke after PHP8 update.%0a* Update documentation.%0a%0a!!! Version 2.3.10 (2022-08-20) [[#v2310]]%0a* Update for PHP 8.1 (reported by Armin Bühler).%0a* Forms will now prefill wildcard variables from $DefaultUnsetPageTextVars or $DefaultEmptyPageTextVars.%0a* $EnablePmSyntax = 3; will enable syntax highlighting in the edit form by default, without the user clicking on "Highlight". Fix occasional text mis-alignment between the text area and the highlighted block.%0a* Update documentation.%0a%0a!!! Version 2.3.9 (2022-08-18) [[#v239]]%0a* Add non-wildcard $DefaultUnsetPageTextVars to %25pmhlt%25[@(:input default:)@] (reported by Johnny).%0a* PmSyntax handles new selectors pre.pmhlt, code.pmhlt.%0a* Update for PHP 8 (PITS:01478).%0a* Update documentation.%0a%0a%0a!!! Version 2.3.8 (2022-07-22) [[#v238]]%0a* PmSyntax fix for 2 different %25pmhlt%25 [@%25hlt%25@] on the same line (reported by Simon).%0a* Fix broken include when the first page doesn't exist.%0a* Update documentation.%0a%0a!!! Version 2.3.7 (2022-06-28) [[#v237]]%0a* $HTTPHeaders add X-Frame-Options (suggested by Imagine Dragon) and Content-Security-Policy to disallow embedding in external websites by default.%0a* $EnableHighlight will now remember any links to PmWiki variables and restore them after the highlighting, see [[thread->https://www.pmwiki.org/pipermail/pmwiki-users/2022-June/064887.html]].%0a* $EnablePmSyntax will now process %25pmhlt%25[@%25hlt pmwiki%25@] in addition to [@%25pmhlt%25@] blocks, and escaped markup after it will be tentatively highlighted.%0a* Update documentation.%0a%0a!!! Version 2.3.6 (2022-06-19) [[#v236]]%0a* Fixes for PHP 8.%0a* Add form attribute "lang".%0a* Sortable tables allow for table headers to have markup such as bold (except links). It will now use a case-insensitive natural ordering.%0a* Allow for $UploadVerifyFunction to modify $upname.%0a* Add variable $PageIndexTermsFunction.%0a* Searchbox allow for removal of submit button if [@label=""@]; add default [@placeholder="$[Search]"@].%0a* Fix author.php may be included before some variables are defined, reported by Said Achmiz.%0a* $EnableHighlight convert code blocks to plain text, see [[thread->https://www.pmwiki.org/pipermail/pmwiki-users/2022-June/064887.html]].%0a* Documentation update.%0a%0a%0a!!! Version 2.3.5 (2022-05-23) [[#v235]]%0a* Fix broken list=grouphomes (PITS:01477).%0a* Add DisableSkinParts() helper function for recipes.%0a* HandlePostUpload: add @@$FmtV["$filepath"]@@ and @@$FmtV["$upurl"]@@ with the file path and direct URL to the newly uploaded file.%0a* In pmwiki-utils.js, replace forgotten ''let'' with ''var'' (suggested by SteP).%0a* Update for PHP 8.1.%0a* Update documentation.%0a%0a!!! Version 2.3.4 (2022-04-22) [[#v234]]%0a* Fixes for PHP 8 warnings, reported by Siegfried Seibert.%0a* Update documentation.%0a%0a!!! Version 2.3.3 (2022-03-26) [[#v233]]%0a* Fix for PHP 8 warnings, reported by Jean-Patrick Charrey, Dominique Faure and Siegfried Seibert.%0a* Update README.txt and docs/ files, suggested by Simon Davis.%0a* Update documentation.%0a%0a!!! Version 2.3.2 (2022-02-09) [[#v232]]%0a* Allow for $EnableLocalTimes to define custom duration of the pulled page history.%0a* Rename variable $EnableIncludedPages to $EnableListIncludedPages (avoid ambiguity).%0a* Remove $LinkAlt when an embedded picture without an alternative text fails to load.%0a* PmSyntax:%0a** Allow for line breaks \\ inside headings, tables, list items (like the core).%0a** Parallel processing of multiple blocks.%0a* Add scripts/utils.php; move loading of pmwiki-utils.js and PmSyntax to scripts/utils.js.%0a** Add $EnablePmUtils, default enabled.%0a** Parallel processing of the pmwiki-utils.js utility functions.%0a** Move pmwiki-utils.js move to $HTMLHeaderFmt (often prevents page redraw with the TOC/PmToggle/LocalTimes).%0a* Fix bug causing invalid page name when the name is "Group.0".%0a* Fix PHP 8.1.2 warnings, reported by Jürgen Godau and Dominique Faure.%0a* LocaltTimes fix "rcnew" classes for wikis with the older format.%0a* Update documentation.%0a%0a!!! Version 2.3.1 (2022-01-15) [[#v231]]%0a%0a* Fix the release script which broke the $VersionNum variable and the [@[[#anchor]]@] markup with the PmWiki-responsive skin.%0a%0a!!! Version 2.3.0 (2022-01-15) [[#v230]]%0a* Add PmSyntax, $EnablePmSyntax, $CustomSyntax, [@{$EnabledIMap}@], see Cookbook:PmSyntax, Cookbook:CustomSyntax.%0a* [@(:markup:)@] can now have @@class=norender@@ to only show the source code without processing it.%0a* Updates for PHP 8.1, hide warnings, add PSFT() replacement for strftime() and 2 callbacks, $EnableFTimeNew, update core function calls, add [@%25o@] for the ordinal suffix of the date (PITS:01418).%0a* Notify: @@tz=@@ (timezone) per-user.%0a* PageList add category= argument (PITS:00447, PITS:01475); link= and category= now accept multiple pages, wildcards, and negations (PITS:00908).%0a* [=[[!Category]]=] links can have alternative text (PITS:01095).%0a* Simplify/optimize pmwiki-utils.js when using datasets, simplify sorting of table rows without cloning, add LocalTimes().%0a* Page history diff anchors to also have "id=" attributes in addition to "name=".%0a* Add $EnableLocalTimes (default disabled) and styles, add HandleDiffList().%0a* Add markup %25pmhlt%25[@@2022-01-09T08:35:00Z@]%25%25 output as %3ctime>; localized if $EnableLocalTimes.%0a** Add $CurrentLocalTime in the above format, used by default in $RecentChangesFmt.%0a* Add $EnableRecentUploads (only Site.AllRecentChanges, only if $RecentUploadsFmt not defined).%0a* PmTOC update CSS for properly indented subheadings.%0a* Edit form $EnableIncludedPages, add placeholders to e_changesummary and e_author. Enable $EnableNotSavedWarning, add to sample-config.php. EditHelp to behave more like a word processor, typing "Enter" twice without writing text removes the preceding bullet.%0a* Responsive skin details>summary:hover {color:navy, cursor: pointer;}.%0a* PrintDiff() add classes for the delay between edits: diffday, diffweek, diffmonth, diffyear.%0a* Add helper function @@DownloadUrl($pagename, $path)@@ moved from @@LinkUpload()@@.%0a* Add [=$[ULby]=] i18n string 'uploaded by'.%0a* Update documentation.%0a%0a!!! [[#older]] Older versions%0a[[(PmWiki:)ChangeLog Archive]] - changes prior to version 2.3.0.%0a +time=1724224028 diff --git a/wikilib.d/PmWiki.CustomMarkup b/wikilib.d/PmWiki.CustomMarkup index fd56042b..048e5c87 100644 --- a/wikilib.d/PmWiki.CustomMarkup +++ b/wikilib.d/PmWiki.CustomMarkup @@ -1,9 +1,9 @@ -version=pmwiki-2.3.30 ordered=1 urlencoded=1 -author=simon +version=pmwiki-2.3.36 ordered=1 urlencoded=1 +author=Petko charset=UTF-8 -csum=add Keep Block (+154) +csum=patterns must use "/" (forward slash) as the delimiters (+316) name=PmWiki.CustomMarkup -rev=199 +rev=201 targets=Cookbook.MarkupDirectiveFunctions,PmWiki.PageTextVariables,PmWiki.Links,PmWiki.CustomMarkup,PmWiki.DebugVariables,Cookbook.Cookbook,PmWiki.LocalCustomizations,Cookbook.ParseArgs,PmWiki.ReleaseNotes,PmWiki.Functions,PmWiki.BasicVariables,PmWiki.CustomMarkup-Talk,PmWiki.MailingLists,Cookbook.JavaScript,Cookbook.JavaScript-Editable,PmWiki.Skins,PmWiki.LayoutVariables,PmWiki.CustomMarkupAlt,Category.Markup,!Markup -text=(:Summary: Using the Markup() function for custom wiki syntax; migration to PHP 5.5:)%0a(:Audience: administrators (intermediate) :)%0a%0aPmWiki's markup translation engine is handled by a set of rules; each rule searches for a specific pattern in the markup text and replaces it with some replacement text. Internally, this is accomplished by using PHP's "[[https://www.php.net/manual/en/function.preg-replace.php | preg_replace]]" function.%0a%0a!! Introduction%0aRules are added to the translation engine via PmWiki's %25hlt php%25@@Markup()@@ function, which looks like%0a->%25hlt php%25[@Markup($name, $when, $pattern, $replace); # if no evaluation is needed, or if PHP %3c 5.5@]%0a->%25hlt php%25@@Markup($name, $when, $pattern, $replace_function); # if evaluation is needed@@'%0a'^#^' DEPRECATED, will not work as of PHP 7.2%0a->@@{-Markup_e($name, $when, $pattern, $replace); # if evaluation is needed and 5.5%3c=PHP%3c=7.1-}@@%0a%0a* %25hlt php%25[@$name@] is a unique name (a string) given to the rule%0a* %25hlt php%25[@$when@] says when the rule should be applied relative to other rules or phases, can be preceded by "@@%3c@@" or "@@>@@"%0a* %25hlt php%25[@$pattern@] is the pattern to be searched for in the markup text%0a* %25hlt php%25[@$replace@] is the text or HTML that should replace the matched pattern.%0a* %25hlt php%25[@$replace_function@] is the name of the function which should be called with the match, and should return the replacement.%0a%0a!! Simple markup%0aSee [[Cookbook:Markup Directive Functions]] a new helper function (as of PmWiki 2.3.11) that makes it easy to add custom markup directives.%0a%0a%0a!!! Example%0aFor example, here's the code that creates the rule for %25pmhlt%25[@''emphasized text''@] (in ''@@scripts/stdmarkup.php@@''):%0a->%25hlt php%25[@Markup("em", "inline", "/''(.*?)''/", "%3cem>$1%3c/em>");@]%0a%0aBasically this statement says to create a rule called "@@em@@" to be performed with the other "@@inline@@" markups, and the rule replaces any text inside two pairs of single quotes with the same text ($1) surrounded by %25hlt html%25[@%3cem>@] and [@%3c/em>@].%0a%0a!!! Sequence in which rules are applied%0aThe first two parameters to %25hlt php%25@@Markup()@@ are used to specify the sequence in which rules should be applied. The first parameter provides a name for a rule -- "[@em@]" in the example above. We could've chosen other names such as "[@''@]", or even "[@twosinglequotes@]". In general PmWiki uses the markup itself to name the rule (i.e., PmWiki uses "[@''@]" instead of "[@em@]"), but to keep this example easier to read later on we'll use a mnemonic name for now.%0a%0aThe second parameter says that this rule is to be done along with the other "inline" markups. PmWiki divides the translation process into a number of phases (or placeholder rules):%0a%0a _begin start of translation%0a [={$var}=] [[Page Text Variables]] happen here.%0a fulltext translations to be performed on the full text %0a split conversion of the full markup text into lines to be processed%0a directives directive processing%0a inline inline markups%0a links conversion of [[links]], url-links, and WikiWords %0a block block markups%0a style style handling %0a _end end of translation%0a%0a%0aThis argument is normally specified as a left-angle bracket "@@%3c@@" ("before") or a right-angle bracket "@@>@@" ("after") followed by the name of another rule or the name of a phase. %0a%0aThus, specifying "@@inline@@" for the second parameter says that this rule should be applied when the other "@@inline@@" rules are being performed. If we want a rule to be performed with the directives -- i.e., before inline rules are processed, we would specify "@@directives@@" or "@@%3cinline@@" for the second parameter.%0a%0a!!! [={$var}=] and [=(:if ...:)=] conditionals%0aA significant rule in terms of ordering is "[@{$var}@]" which substitutes variables -- if you say "[@%3c{$var}@]" then your markup will be processed before variables are substituted whereas if you say ">[={$var}=]" then your markup will be processed after variables are substituted. This happens before conditional %25pmhlt%25[@(:if...:)@] expressions, which is why page text variables are processed even if they are defined inside [@(:if false:)@].%0a%0a!!! Markup regular expression definition%0aThe third parameter is a Perl-compatible regular expression. Basically, it is a slash, a [[regular expression -> https://www.php.net/manual/en/reference.pcre.pattern.syntax.php]], another slash, and a set of optional [[modifiers -> https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php]].%0a%0aThe example uses the pattern string [@"/''(.*?)''/"@], which uses [@''(.*?)''@] as the regular expression and no options. (The regular expression says "find two single quotes in succession, then as few arbitrary characters as are needed to make the match find something, then two additional single quotes in succession"; the parentheses "capture" a part of the wikitext for later use.)%0a%0a!!! Replacement text%0aThe fourth parameter is the replacement text that should be inserted instead of the marked-up wikitext. You can use [@$1@], [@$2@], etc. to insert the text from the first, second etc. parenthesised part of the regular expression.%0a%0aIn the example, we have %25hlt html%25[@"%3cem>$1%3c/em>"@], which is an [@%3cem>@], the text matched by the first parentheses (i.e. by the [@.*?@] section of the pattern), and [@%3c/em>@].%0a%0aHere's a rule for %25pmhlt%25[@@@monospaced@@@] text:%0a%0a->%25hlt php%25[@Markup("@@", "inline", "/@@(.*?)@@/", "%3ccode>$1%3c/code>");@]%0a%0aand for a [@[:comment ...:]@] directive that is simply removed from the output:%0a%0a->%25hlt php%25[@Markup("comment", "directives", "/\\[:comment .*?:\\]/", '');@]%0a%0aOkay, now how about the rule for %25pmhlt%25[@'''strong emphasis'''@]? We have to be a bit careful here, because although this translation should be performed along with other inline markup, we also have to make sure that the rule for [@'''@] is handled ''before'' the rule for [@''@], because [@'''@] also contains [@''@]. The second parameter to %25hlt php%25@@Markup()@@ can be used to specify the new rule's relationship to any other rule:%0a%0a->%25hlt php%25[@Markup("strong", "%3cem", "/'''(.*?)'''/", "%3cstrong>$1%3c/strong>");@]%0a%0aThis creates a rule called "@@strong@@", and the second parameter "@@%3cem@@" says to be sure that this rule is processed before the "@@em@@" rule we defined above. If we wanted to do something after the "@@em@@" rule, we would use "@@>em@@" instead. Thus, it's possible to add rules at any point in PmWiki's markup translation process in an extensible manner. (In fact, the "@@inline@@", "@@block@@", "@@directives@@", etc., phases above are just placeholder rules used to provide an overall sequence for other rules. Thus one can use "@@%3cinline@@" to specify rules that should be handled before any other inline rules.) %0a%0aIf you want to disable available markup just call e.g.:%0a%0a->%25hlt php%25[@DisableMarkup("strong");@]%0a%0aPmWiki's default markup rules are defined in the ''@@scripts/stdmarkup.php@@'' file. To see the entire translation table as the program is running, the @@scripts/diag.php@@ module adds "[@?action=ruleset@]", which displays the set of defined markup rules in the sequence in which they will be processed. You can see it at [[CustomMarkup?action=ruleset | CustomMarkup?action=ruleset]]. You must first enable the action by setting $EnableDiag = 1 in your configuration file.%0a%0a!! @@%3c:vspace>@@ and @@%3c:block>@@%0a@@%3c:vspace>@@ is inserted into the page text very early in page text processing to preserve an empty line (i.e. two newlines in a row). Very late in processing HTML is inserted into the page output to preserve the empty lines.%0aUnless markup processing detects this it can be ignored.%0a%0a@@%3c:block>@@\\%0aFrom 2.3.19 please use:%0a-> %25hlt php%25[@return KeepBlock($out); @]%0aPreviously usage could look like this: %0a-> %25hlt php%25[@return '%3c:block>'. Keep($out); @]%0a%0aAt the start of a line, @@%3c:block>@@ means "start a block-level element",%0ai.e. break out of the paragraphs.%0a%0aSay you have these markups:%0a* %25pmhlt%25@@(:abc:)@@ returns 'ABC'%0a* %25pmhlt%25@@(:def:)@@ returns '%3c:block>DEF'%0a%0aThis wiki text:%0a Some text%0a %25pmhlt%25@@(:abc:)@@%0a some other text%0a%0awill produce this HTML (simplified):%0a %25hlt html%25[@%3cp>Some text%0a ABC%0a some other text%3c/p>@]%0a%0aWhile this wiki text:%0a Some text%0a %25pmhlt%25@@(:def:)@@%0a some other text%0a%0awill produce this HTML (simplified):%0a %25hlt html%25[@%3cp>Some text%3c/p>%0a DEF%0a %3cp>some other text%3c/p>@]%0a%0aThis is intended for a markup rule to return a block level element like%0a%25hlt html%25@@%3cdiv>...%3c/div>@@ that is not allowed inside an HTML paragraph.%0a%0a!! Other common examples%0a!!! Define a custom markup to produce a specific HTML or Javascript sequence%0a%0aSuppose an admin wants to have a simple "%25pmhlt%25[@(:example:)@]" markup that will always produce a fixed HTML string in the output, such as for a webring, Google AdSense display, or Javascript. The %25hlt php%25@@Markup()@@ call to do this would be:%0a-> %25hlt php%25[@%0aMarkup('example', 'directives',%0a '/\\(:example:\\)/',%0a Keep("%3cdiv class='example'>%3cp>Here is a %0a %3ca target='_blank' href='https://www.example.com'>link%3c/a> to%0a %3cem>example.com%3c/em>%3c/p>%3c/div>") );%0a@]%0a%0a* The first argument is a unique name for the markup ("example").%0a* The second argument says to perform this markup along with other directives.%0a* The third argument is the pattern to look for "(:example:)".%0a* The fourth argument is the HTML that "(:example:)" is to be replaced with. We use the %25hlt php%25@@Keep()@@ function here to prevent the output from being further processed by PmWiki's markup rule -- in the above example, we don't want the https://www.example.com url to be again converted to a link.%0a%0a[[#random]]%0a!!! Define a markup to call a custom function that returns content%0a%0a->%25red%25 The /e modifier has been deprecated and should not be used in ongoing development. See [[#php55|below]] for more details.%25%25%0a%0aFor older PHP versions (%3c 7.2) an 'e' option on the [@$pattern@] parameter causes the [@$replace@] parameter to be treated as a PHP expression to be evaluated instead of replacement text. To avoid using the deprecated e/ parameter, a markup to produce a random number between 1 and 100 might now look like:%0a-> %25hlt php%25[@%0aMarkup('random', 'directives',%0a '/\\(:random:\\)/',%0a "MyRandomFunction");%0afunction MyRandomFunction() {%0a return rand(1, 100);%0a}%0a@]%0a%0aThis calls the PHP built-in %25hlt php%25@@rand()@@ function and substitutes the directive with the result. Any function can be called, including functions defined in a [[local customization(s)]] file or in [[Cookbook:Cookbook|Cookbook]] recipes.%0a%0aArguments can also be passed by using regular expression capturing parentheses, thus%0a-> %25hlt php%25[@%0aMarkup('randomargs', 'directives',%0a '/\\(:random (\\d+) (\\d+):\\)/',%0a "MyRandomFunction");%0afunction MyRandomFunction($m) {%0a return rand($m[1], $m[2]);%0a}%0a@]%0a%0awill cause the markup %25pmhlt%25[@(:random 50 100:)@] to generate a random number between 50 and 100.%0a%0a->%25note%25 Note: the /e modifier in regular expressions is deprecated since PHP version 5.5, and removed since PHP version 7. The reason for this is, that malicious authors could pass strings that could cause arbitrary and undesirable PHP functions to be executed.%0a%0aFor a PmWiki function to help with parsing arbitrary sequences of arguments and key=value pairs, see Cookbook:ParseArgs.%0a%0a[[#php55]]%0a!! Migration to PHP 5.5 and @@Markup_e()@@%0aSince PHP version 5.5, the @@/e@@ evaluation modifier is deprecated and some hosting providers don't allow its use.%0a%0aRecent [[ReleaseNotes | versions]] of the PmWiki core (2.2.58 and newer) allow new ways to define markup rules without being dependent on the @@/e@@ eval modifier. The historical ways to define markup rules are not removed and work, but may be incompatible with PHP 5.5 installations.%0a%0a''Note: whether your replacement pattern needs evaluation or not, you must use %25hlt php%25@@Markup()@@%25%25 and %25red%25not @@Markup_e()@@.%25%25'' The latter is deprecated and should no longer be used for new recipes and customizations, and old recipes using @@Markup_e@@ should be upgraded to the new format.%0a%0aThe examples below all require PmWiki 2.2.58 (2013-12-25) or newer but the latest version is recommended.%0a%0a>>frame%3c%3c%0aTHE SHORT ANSWER: If your markup regular expression (the 3rd argument) contains an "e" after the closing slash (i.e., @@/regex/e@@ or @@/regex/se@@ or etc) AND your 4th argument is entirely surrounded with double-quotes then you may be able to get away with simply following these simple steps:%0a%0a# Delete the "e" from after the closing slash in the 3rd argument%0a# Create a new replacement function with $m as argument.%0a# In your function, the previous occurrences of '$1', '$2', etc. are now found as $m[1], $m[2], etc. You should no longer call @@[[Functions#PSS|PSS()]]@@.%0a# In your function, call %25hlt php%25@@extract($GLOBALS['MarkupToHTML']);@@ in order to get the current $pagename and @@$markupid@@.%0a# Your function needs to '''return''' the result from the markup processing, either html or another markup.%0a# Set the name of the replacement function as 4th argument of the Markup() call.%0a%0aIn some cases this will not suffice - it depends on how quoting was done - but in many cases following these simple steps will result in PHP 5.5+ compatibility. %0a%0aIf you try those steps and are still having problems then continue to read below for a deeper understanding.%0a>>%3c%3c%0a%0aThe following is acceptable for PHP 5.5+ (compatible with PmWiki 2.2.58+, will also work in PHP 5.4 and older)%0a* %25hlt php%25@@Markup($name, $when, $pattern, $replace)@@; %0a** @@$pattern@@ can no longer have an "@@/e@@" modifier%0a** @@$replace@@ can be a function name (callback) which will be called with the array of matches as argument%0a** instead of a string, the fourth parameter can be a definition of an anonymous function (note you can use anon functions this way since [[https://www.php.net/manual/en/functions.anonymous.php | PHP 5.3.0+]]).%0a%0a* {-@@Markup_e($name, $when, $pattern, $replace)@@;-} %25red%25 DEPRECATED, should no longer be used%0a%0aExamples:%0a%0a* For PHP 5.4 and older, this was acceptable:%25hlt php%25[@%0aMarkup('randomargs', 'directives',%0a '/\\(:random (\\d+) (\\d+):\\)/e',%0a "rand('$1', '$2')"%0a );@]%0a%0a* For PHP 5.5 and newer, $replace is callback, we call %25hlt php%25@@Markup()@@:[@%0aMarkup('randomargs', 'directives',%0a '/\\(:random (\\d+) (\\d+):\\)/',%0a "MyRandom"%0a );%0afunction MyRandom($m) { # $m = matches%0a return rand($m[1], $m[2]); # note "return" is used, unlike before%0a}%0a@]%0a %25note%25 This will also work in PHP 5.4 and older%25%25%0a%0aOther example:%0a* PHP 5.4 or older: %25hlt php%25[@%0aMarkup('Maxi:','%3clinks',%0a "/\\b([Mm]axi:)([^\\s\"\\|\\[\\]]+)(\"([^\"]*)\")?/e",%0a "Keep(LinkMaxi(\$pagename,'$1','$2','$4','$1$2'),'L')"%0a );%0a@]%0a%0a* PHP 5.5 or newer, PmWiki 2.2.58+, $replace is a function name: %25hlt php%25[@%0aMarkup('Maxi:','%3clinks',%0a "/\\b([Mm]axi:)([^\\s\"\\|\\[\\]]+)(\"([^\"]*)\")?/",%0a "LinkMaxi"%0a );%0afunction LinkMaxi($m) {%0a extract($GLOBALS['MarkupToHTML']); # to get $pagename%0a # do stuff with $m[1], $m[2], etc.%0a return Keep($out, 'L');%0a}%0a@]%0a %25note%25 This will also work in PHP 5.4 and older%25%25%0a%0a* $replace can also be a callback function, we call %25hlt php%25@@Markup()@@: [@%0aMarkup('Maxi:','%3clinks',%0a "/\\b([Mm]axi:)([^\\s\"\\|\\[\\]]+)(\"([^\"]*)\")?/",%0a "CallbackMaxi"%0a);%0afunction CallbackMaxi($m) {%0a extract($GLOBALS["MarkupToHTML"]); # to get $pagename%0a return Keep(LinkMaxi($pagename,$m[1],$m[2],$m[4],$m[1].$m[2]),'L');%0a}%0a@]%0a %25note%25 This will also work in PHP 5.4 and older%25%25%0a%0aThe above may seem complicated, but it is actually simpler to use your own callback function:%0a-> %25hlt php%25[@%0aMarkup('mykey', 'directives', %0a '/\\(:mydirective (.*?) (.*?):\\)/i',%0a 'MyFunction'%0a);%0afunction MyFunction($m) {%0a extract($GLOBALS["MarkupToHTML"]);%0a%0a # ... do stuff with $m (the matches), drop PSS() ...%0a%0a return $out; # or return Keep($html);%0a}%0a@]%0a%0aIf you have any questions about the new way to define custom markup, you can ask us [[PmWiki:CustomMarkup-Talk|at the talk page]] or on the [[PmWiki/mailing lists]].%0a%0a%0a!!FAQ%0a>>faq%3c%3c [[#faq]]%0aQ: How can I embed JavaScript into a page's output?%0aA: There are several ways to do this. The [[Cookbook:JavaScript]] recipe describes a simple means for embedding static JavaScript into web pages using [[custom markup]]. For editing JavaScript directly in wiki pages (which can pose various security risks), see the [[(Cookbook:)JavaScript-Editable]] recipe. For JavaScript that is to appear in headers or footers of pages, the [[skin(s)]] template can be modified directly, or %3cscript> statements can be inserted using the $HTMLHeaderFmt array.%0a%0aQ: How would I create a markup %25pmhlt%25(''[@(:nodiscussion:)@]'') that will set a page variable (''[@{$HideDiscussion}@]'') which can be used by ''[@(:if enabled HideDiscussion:)@]'' in [=.PageActions=]?%0aA: Add the following section of code to your @@config.php@@%0a-> %25hlt php%25[@%0aSDV($HideDiscussion, 0); #define var name%0aMarkup('hideDiscussion', '%3c{$var}',%0a '/\\(:nodiscussion:\\)/', 'setHideDiscussion'); %0afunction setHideDiscussion() { %0a global $HideDiscussion; %0a $HideDiscussion = true;%0a} %0a@]%0a%0aThis will enable the %25pmhlt%25@@[=(:if enabled HideDiscussion:)=]@@ markup to be used. If you want to print the current value of [={$HideDiscussion}=] (for testing purposes) on the page, you'll also need to add the line: \\%0a%25hlt php%25@@[=$FmtPV['$HideDiscussion'] = '$GLOBALS["HideDiscussion"]';=]@@%0a%0a%0aQ: It appears that (.*?) does not match newlines in these functions, making the above example inoperable if the text to be wrapped in %3cem> contains new lines.%0aA: If you include the "s" modifier on the regular expression then the dot (.) will match newlines. Thus your regular expression will be "/STUFF(.*?)/s". That s at the very end is what you are looking for. If you start getting into multi-line regexes you may be forced to look at the m option as well - let's anchors (^ and $) match not begin/end of strings but also begin/end of lines (i.e., right before/after a newline). Also make sure your markup is executed during the fulltext phase.%0a %0aQ: [[#PRR]] How can the text returned by my markup function be re-processed by the markup engine? %0aA: If the result of your markup contains more markup that should be processed, you have two options. First is to select a "when" argument that is processed earlier than the markup in your result. For example, if your markup may return [=[[links]]=], your "when" argument could be @@"%3clinks"@@ and your markup will be processed before the links markup. The second option is to call the %25hlt php%25@@PRR()@@ function in your markup definition or inside your markup function. In this case, after your markup is processed, PmWiki will restart all markups from the beginning. %0a%0aQ: How do I get started writing recipes and creating my own custom markup?%0aA: [[PmWiki:CustomMarkupAlt|(alternate) Introduction to custom markup for Beginners]]%0a%0aQ: How do I make a rule that runs once at the end of all other rule processing?%0aA: Use this statement instead of the usual %25hlt php%25@@Markup()@@ call:%0a-->%25hlt php%25@@$MarkupFrameBase['posteval']['myfooter'] = "\$out = onetimerule(\$out);";@@%0a%0aCategory: [[!Markup]] -time=1708148675 +text=(:Summary: Using the Markup() function for custom wiki syntax; migration to PHP 5.5:)%0a(:Audience: administrators (intermediate) :)%0a%0aPmWiki's markup translation engine is handled by a set of rules; each rule searches for a specific pattern in the markup text and replaces it with some replacement text. Internally, this is accomplished by using PHP's "[[https://www.php.net/manual/en/function.preg-replace.php | preg_replace]]" function.%0a%0a%25note%25 Note: The patterns provided to the Markup() function must use "/" (forward slash) as the delimiters. Unlike preg_replace(), which allows a variety of punctuation characters as delimiters, this function strictly requires the use of "/" for delimiting the regular expression pattern.%0a%0a!! Introduction%0aRules are added to the translation engine via PmWiki's %25hlt php%25@@Markup()@@ function, which looks like%0a->%25hlt php%25[@Markup($name, $when, $pattern, $replace); # if no evaluation is needed, or if PHP %3c 5.5@]%0a->%25hlt php%25@@Markup($name, $when, $pattern, $replace_function); # if evaluation is needed@@'%0a'^#^' DEPRECATED, will not work as of PHP 7.2%0a->@@{-Markup_e($name, $when, $pattern, $replace); # if evaluation is needed and 5.5%3c=PHP%3c=7.1-}@@%0a%0a* %25hlt php%25[@$name@] is a unique name (a string) given to the rule%0a* %25hlt php%25[@$when@] says when the rule should be applied relative to other rules or phases, can be preceded by "@@%3c@@" or "@@>@@"%0a* %25hlt php%25[@$pattern@] is the pattern to be searched for in the markup text, using "/" as delimiters.%0a* %25hlt php%25[@$replace@] is the text or HTML that should replace the matched pattern.%0a* %25hlt php%25[@$replace_function@] is the name of the function which should be called with the match, and should return the replacement.%0a%0a!! Simple markup%0aSee [[Cookbook:Markup Directive Functions]] a new helper function (as of PmWiki 2.3.11) that makes it easy to add custom markup directives.%0a%0a%0a!!! Example%0aFor example, here's the code that creates the rule for %25pmhlt%25[@''emphasized text''@] (in ''@@scripts/stdmarkup.php@@''):%0a->%25hlt php%25[@Markup("em", "inline", "/''(.*?)''/", "%3cem>$1%3c/em>");@]%0a%0aBasically this statement says to create a rule called "@@em@@" to be performed with the other "@@inline@@" markups, and the rule replaces any text inside two pairs of single quotes with the same text ($1) surrounded by %25hlt html%25[@%3cem>@] and [@%3c/em>@].%0a%0a!!! Sequence in which rules are applied%0aThe first two parameters to %25hlt php%25@@Markup()@@ are used to specify the sequence in which rules should be applied. The first parameter provides a name for a rule -- "[@em@]" in the example above. We could've chosen other names such as "[@''@]", or even "[@twosinglequotes@]". In general PmWiki uses the markup itself to name the rule (i.e., PmWiki uses "[@''@]" instead of "[@em@]"), but to keep this example easier to read later on we'll use a mnemonic name for now.%0a%0aThe second parameter says that this rule is to be done along with the other "inline" markups. PmWiki divides the translation process into a number of phases (or placeholder rules):%0a%0a _begin start of translation%0a [={$var}=] [[Page Text Variables]] happen here.%0a fulltext translations to be performed on the full text %0a split conversion of the full markup text into lines to be processed%0a directives directive processing%0a inline inline markups%0a links conversion of [[links]], url-links, and WikiWords %0a block block markups%0a style style handling %0a _end end of translation%0a%0a%0aThis argument is normally specified as a left-angle bracket "@@%3c@@" ("before") or a right-angle bracket "@@>@@" ("after") followed by the name of another rule or the name of a phase. %0a%0aThus, specifying "@@inline@@" for the second parameter says that this rule should be applied when the other "@@inline@@" rules are being performed. If we want a rule to be performed with the directives -- i.e., before inline rules are processed, we would specify "@@directives@@" or "@@%3cinline@@" for the second parameter.%0a%0a!!! [={$var}=] and [=(:if ...:)=] conditionals%0aA significant rule in terms of ordering is "[@{$var}@]" which substitutes variables -- if you say "[@%3c{$var}@]" then your markup will be processed before variables are substituted whereas if you say ">[={$var}=]" then your markup will be processed after variables are substituted. This happens before conditional %25pmhlt%25[@(:if...:)@] expressions, which is why page text variables are processed even if they are defined inside [@(:if false:)@].%0a%0a!!! Markup regular expression definition%0aThe third parameter is a Perl-compatible regular expression. Basically, it is a slash, a [[regular expression -> https://www.php.net/manual/en/reference.pcre.pattern.syntax.php]], another slash, and a set of optional [[modifiers -> https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php]].%0a%0aThe example uses the pattern string [@"/''(.*?)''/"@], which uses [@''(.*?)''@] as the regular expression and no options. (The regular expression says "find two single quotes in succession, then as few arbitrary characters as are needed to make the match find something, then two additional single quotes in succession"; the parentheses "capture" a part of the wikitext for later use.)%0a%0a!!! Replacement text%0aThe fourth parameter is the replacement text that should be inserted instead of the marked-up wikitext. You can use [@$1@], [@$2@], etc. to insert the text from the first, second etc. parenthesised part of the regular expression.%0a%0aIn the example, we have %25hlt html%25[@"%3cem>$1%3c/em>"@], which is an [@%3cem>@], the text matched by the first parentheses (i.e. by the [@.*?@] section of the pattern), and [@%3c/em>@].%0a%0aHere's a rule for %25pmhlt%25[@@@monospaced@@@] text:%0a%0a->%25hlt php%25[@Markup("@@", "inline", "/@@(.*?)@@/", "%3ccode>$1%3c/code>");@]%0a%0aand for a [@[:comment ...:]@] directive that is simply removed from the output:%0a%0a->%25hlt php%25[@Markup("comment", "directives", "/\\[:comment .*?:\\]/", '');@]%0a%0aOkay, now how about the rule for %25pmhlt%25[@'''strong emphasis'''@]? We have to be a bit careful here, because although this translation should be performed along with other inline markup, we also have to make sure that the rule for [@'''@] is handled ''before'' the rule for [@''@], because [@'''@] also contains [@''@]. The second parameter to %25hlt php%25@@Markup()@@ can be used to specify the new rule's relationship to any other rule:%0a%0a->%25hlt php%25[@Markup("strong", "%3cem", "/'''(.*?)'''/", "%3cstrong>$1%3c/strong>");@]%0a%0aThis creates a rule called "@@strong@@", and the second parameter "@@%3cem@@" says to be sure that this rule is processed before the "@@em@@" rule we defined above. If we wanted to do something after the "@@em@@" rule, we would use "@@>em@@" instead. Thus, it's possible to add rules at any point in PmWiki's markup translation process in an extensible manner. (In fact, the "@@inline@@", "@@block@@", "@@directives@@", etc., phases above are just placeholder rules used to provide an overall sequence for other rules. Thus one can use "@@%3cinline@@" to specify rules that should be handled before any other inline rules.) %0a%0aIf you want to disable available markup just call e.g.:%0a%0a->%25hlt php%25[@DisableMarkup("strong");@]%0a%0aPmWiki's default markup rules are defined in the ''@@scripts/stdmarkup.php@@'' file. To see the entire translation table as the program is running, the @@scripts/diag.php@@ module adds "[@?action=ruleset@]", which displays the set of defined markup rules in the sequence in which they will be processed. You can see it at [[CustomMarkup?action=ruleset | CustomMarkup?action=ruleset]]. You must first enable the action by setting $EnableDiag = 1 in your configuration file.%0a%0a!! @@%3c:vspace>@@ and @@%3c:block>@@%0a@@%3c:vspace>@@ is inserted into the page text very early in page text processing to preserve an empty line (i.e. two newlines in a row). Very late in processing HTML is inserted into the page output to preserve the empty lines.%0aUnless markup processing detects this it can be ignored.%0a%0a@@%3c:block>@@\\%0aFrom 2.3.19 please use:%0a-> %25hlt php%25[@return KeepBlock($out); @]%0aPreviously usage could look like this: %0a-> %25hlt php%25[@return '%3c:block>'. Keep($out); @]%0a%0aAt the start of a line, @@%3c:block>@@ means "start a block-level element",%0ai.e. break out of the paragraphs.%0a%0aSay you have these markups:%0a* %25pmhlt%25@@(:abc:)@@ returns 'ABC'%0a* %25pmhlt%25@@(:def:)@@ returns '%3c:block>DEF'%0a%0aThis wiki text:%0a Some text%0a %25pmhlt%25@@(:abc:)@@%0a some other text%0a%0awill produce this HTML (simplified):%0a %25hlt html%25[@%3cp>Some text%0a ABC%0a some other text%3c/p>@]%0a%0aWhile this wiki text:%0a Some text%0a %25pmhlt%25@@(:def:)@@%0a some other text%0a%0awill produce this HTML (simplified):%0a %25hlt html%25[@%3cp>Some text%3c/p>%0a DEF%0a %3cp>some other text%3c/p>@]%0a%0aThis is intended for a markup rule to return a block level element like%0a%25hlt html%25@@%3cdiv>...%3c/div>@@ that is not allowed inside an HTML paragraph.%0a%0a!! Other common examples%0a!!! Define a custom markup to produce a specific HTML or Javascript sequence%0a%0aSuppose an admin wants to have a simple "%25pmhlt%25[@(:example:)@]" markup that will always produce a fixed HTML string in the output, such as for a webring, Google AdSense display, or Javascript. The %25hlt php%25@@Markup()@@ call to do this would be:%0a-> %25hlt php%25[@%0aMarkup('example', 'directives',%0a '/\\(:example:\\)/',%0a Keep("%3cdiv class='example'>%3cp>Here is a %0a %3ca target='_blank' href='https://www.example.com'>link%3c/a> to%0a %3cem>example.com%3c/em>%3c/p>%3c/div>") );%0a@]%0a%0a* The first argument is a unique name for the markup ("example").%0a* The second argument says to perform this markup along with other directives.%0a* The third argument is the pattern to look for "(:example:)".%0a* The fourth argument is the HTML that "(:example:)" is to be replaced with. We use the %25hlt php%25@@Keep()@@ function here to prevent the output from being further processed by PmWiki's markup rule -- in the above example, we don't want the https://www.example.com url to be again converted to a link.%0a%0a[[#random]]%0a!!! Define a markup to call a custom function that returns content%0a%0a->%25red%25 The /e modifier has been deprecated and should not be used in ongoing development. See [[#php55|below]] for more details.%25%25%0a%0aFor older PHP versions (%3c 7.2) an 'e' option on the [@$pattern@] parameter causes the [@$replace@] parameter to be treated as a PHP expression to be evaluated instead of replacement text. To avoid using the deprecated e/ parameter, a markup to produce a random number between 1 and 100 might now look like:%0a-> %25hlt php%25[@%0aMarkup('random', 'directives',%0a '/\\(:random:\\)/',%0a "MyRandomFunction");%0afunction MyRandomFunction() {%0a return rand(1, 100);%0a}%0a@]%0a%0aThis calls the PHP built-in %25hlt php%25@@rand()@@ function and substitutes the directive with the result. Any function can be called, including functions defined in a [[local customization(s)]] file or in [[Cookbook:Cookbook|Cookbook]] recipes.%0a%0aArguments can also be passed by using regular expression capturing parentheses, thus%0a-> %25hlt php%25[@%0aMarkup('randomargs', 'directives',%0a '/\\(:random (\\d+) (\\d+):\\)/',%0a "MyRandomFunction");%0afunction MyRandomFunction($m) {%0a return rand($m[1], $m[2]);%0a}%0a@]%0a%0awill cause the markup %25pmhlt%25[@(:random 50 100:)@] to generate a random number between 50 and 100.%0a%0a->%25note%25 Note: the /e modifier in regular expressions is deprecated since PHP version 5.5, and removed since PHP version 7. The reason for this is, that malicious authors could pass strings that could cause arbitrary and undesirable PHP functions to be executed.%0a%0aFor a PmWiki function to help with parsing arbitrary sequences of arguments and key=value pairs, see Cookbook:ParseArgs.%0a%0a[[#php55]]%0a!! Migration to PHP 5.5 and @@Markup_e()@@%0aSince PHP version 5.5, the @@/e@@ evaluation modifier is deprecated and some hosting providers don't allow its use.%0a%0aRecent [[ReleaseNotes | versions]] of the PmWiki core (2.2.58 and newer) allow new ways to define markup rules without being dependent on the @@/e@@ eval modifier. The historical ways to define markup rules are not removed and work, but may be incompatible with PHP 5.5 installations.%0a%0a''Note: whether your replacement pattern needs evaluation or not, you must use %25hlt php%25@@Markup()@@%25%25 and %25red%25not @@Markup_e()@@.%25%25'' The latter is deprecated and should no longer be used for new recipes and customizations, and old recipes using @@Markup_e@@ should be upgraded to the new format.%0a%0aThe examples below all require PmWiki 2.2.58 (2013-12-25) or newer but the latest version is recommended.%0a%0a>>frame%3c%3c%0aTHE SHORT ANSWER: If your markup regular expression (the 3rd argument) contains an "e" after the closing slash (i.e., @@/regex/e@@ or @@/regex/se@@ or etc) AND your 4th argument is entirely surrounded with double-quotes then you may be able to get away with simply following these simple steps:%0a%0a# Delete the "e" from after the closing slash in the 3rd argument%0a# Create a new replacement function with $m as argument.%0a# In your function, the previous occurrences of '$1', '$2', etc. are now found as $m[1], $m[2], etc. You should no longer call @@[[Functions#PSS|PSS()]]@@.%0a# In your function, call %25hlt php%25@@extract($GLOBALS['MarkupToHTML']);@@ in order to get the current $pagename and @@$markupid@@.%0a# Your function needs to '''return''' the result from the markup processing, either html or another markup.%0a# Set the name of the replacement function as 4th argument of the Markup() call.%0a%0aIn some cases this will not suffice - it depends on how quoting was done - but in many cases following these simple steps will result in PHP 5.5+ compatibility. %0a%0aIf you try those steps and are still having problems then continue to read below for a deeper understanding.%0a>>%3c%3c%0a%0aThe following is acceptable for PHP 5.5+ (compatible with PmWiki 2.2.58+, will also work in PHP 5.4 and older)%0a* %25hlt php%25@@Markup($name, $when, $pattern, $replace)@@; %0a** @@$pattern@@ can no longer have an "@@/e@@" modifier%0a** @@$replace@@ can be a function name (callback) which will be called with the array of matches as argument%0a** instead of a string, the fourth parameter can be a definition of an anonymous function (note you can use anon functions this way since [[https://www.php.net/manual/en/functions.anonymous.php | PHP 5.3.0+]]).%0a%0a* {-@@Markup_e($name, $when, $pattern, $replace)@@;-} %25red%25 DEPRECATED, should no longer be used%0a%0aExamples:%0a%0a* For PHP 5.4 and older, this was acceptable:%25hlt php%25[@%0aMarkup('randomargs', 'directives',%0a '/\\(:random (\\d+) (\\d+):\\)/e',%0a "rand('$1', '$2')"%0a );@]%0a%0a* For PHP 5.5 and newer, $replace is callback, we call %25hlt php%25@@Markup()@@:[@%0aMarkup('randomargs', 'directives',%0a '/\\(:random (\\d+) (\\d+):\\)/',%0a "MyRandom"%0a );%0afunction MyRandom($m) { # $m = matches%0a return rand($m[1], $m[2]); # note "return" is used, unlike before%0a}%0a@]%0a %25note%25 This will also work in PHP 5.4 and older%25%25%0a%0aOther example:%0a* PHP 5.4 or older: %25hlt php%25[@%0aMarkup('Maxi:','%3clinks',%0a "/\\b([Mm]axi:)([^\\s\"\\|\\[\\]]+)(\"([^\"]*)\")?/e",%0a "Keep(LinkMaxi(\$pagename,'$1','$2','$4','$1$2'),'L')"%0a );%0a@]%0a%0a* PHP 5.5 or newer, PmWiki 2.2.58+, $replace is a function name: %25hlt php%25[@%0aMarkup('Maxi:','%3clinks',%0a "/\\b([Mm]axi:)([^\\s\"\\|\\[\\]]+)(\"([^\"]*)\")?/",%0a "LinkMaxi"%0a );%0afunction LinkMaxi($m) {%0a extract($GLOBALS['MarkupToHTML']); # to get $pagename%0a # do stuff with $m[1], $m[2], etc.%0a return Keep($out, 'L');%0a}%0a@]%0a %25note%25 This will also work in PHP 5.4 and older%25%25%0a%0a* $replace can also be a callback function, we call %25hlt php%25@@Markup()@@: [@%0aMarkup('Maxi:','%3clinks',%0a "/\\b([Mm]axi:)([^\\s\"\\|\\[\\]]+)(\"([^\"]*)\")?/",%0a "CallbackMaxi"%0a);%0afunction CallbackMaxi($m) {%0a extract($GLOBALS["MarkupToHTML"]); # to get $pagename%0a return Keep(LinkMaxi($pagename,$m[1],$m[2],$m[4],$m[1].$m[2]),'L');%0a}%0a@]%0a %25note%25 This will also work in PHP 5.4 and older%25%25%0a%0aThe above may seem complicated, but it is actually simpler to use your own callback function:%0a-> %25hlt php%25[@%0aMarkup('mykey', 'directives', %0a '/\\(:mydirective (.*?) (.*?):\\)/i',%0a 'MyFunction'%0a);%0afunction MyFunction($m) {%0a extract($GLOBALS["MarkupToHTML"]);%0a%0a # ... do stuff with $m (the matches), drop PSS() ...%0a%0a return $out; # or return Keep($html);%0a}%0a@]%0a%0aIf you have any questions about the new way to define custom markup, you can ask us [[PmWiki:CustomMarkup-Talk|at the talk page]] or on the [[PmWiki/mailing lists]].%0a%0a%0a!!FAQ%0a>>faq%3c%3c [[#faq]]%0aQ: How can I embed JavaScript into a page's output?%0aA: There are several ways to do this. The [[Cookbook:JavaScript]] recipe describes a simple means for embedding static JavaScript into web pages using [[custom markup]]. For editing JavaScript directly in wiki pages (which can pose various security risks), see the [[(Cookbook:)JavaScript-Editable]] recipe. For JavaScript that is to appear in headers or footers of pages, the [[skin(s)]] template can be modified directly, or %3cscript> statements can be inserted using the $HTMLHeaderFmt array.%0a%0aQ: How would I create a markup %25pmhlt%25(''[@(:nodiscussion:)@]'') that will set a page variable (''[@{$HideDiscussion}@]'') which can be used by ''[@(:if enabled HideDiscussion:)@]'' in [=.PageActions=]?%0aA: Add the following section of code to your @@config.php@@%0a-> %25hlt php%25[@%0aSDV($HideDiscussion, 0); #define var name%0aMarkup('hideDiscussion', '%3c{$var}',%0a '/\\(:nodiscussion:\\)/', 'setHideDiscussion'); %0afunction setHideDiscussion() { %0a global $HideDiscussion; %0a $HideDiscussion = true;%0a} %0a@]%0a%0aThis will enable the %25pmhlt%25@@[=(:if enabled HideDiscussion:)=]@@ markup to be used. If you want to print the current value of [={$HideDiscussion}=] (for testing purposes) on the page, you'll also need to add the line: \\%0a%25hlt php%25@@[=$FmtPV['$HideDiscussion'] = '$GLOBALS["HideDiscussion"]';=]@@%0a%0a%0aQ: It appears that (.*?) does not match newlines in these functions, making the above example inoperable if the text to be wrapped in %3cem> contains new lines.%0aA: If you include the "s" modifier on the regular expression then the dot (.) will match newlines. Thus your regular expression will be "/STUFF(.*?)/s". That s at the very end is what you are looking for. If you start getting into multi-line regexes you may be forced to look at the m option as well - let's anchors (^ and $) match not begin/end of strings but also begin/end of lines (i.e., right before/after a newline). Also make sure your markup is executed during the fulltext phase.%0a %0aQ: [[#PRR]] How can the text returned by my markup function be re-processed by the markup engine? %0aA: If the result of your markup contains more markup that should be processed, you have two options. First is to select a "when" argument that is processed earlier than the markup in your result. For example, if your markup may return [=[[links]]=], your "when" argument could be @@"%3clinks"@@ and your markup will be processed before the links markup. The second option is to call the %25hlt php%25@@PRR()@@ function in your markup definition or inside your markup function. In this case, after your markup is processed, PmWiki will restart all markups from the beginning. %0a%0aQ: How do I get started writing recipes and creating my own custom markup?%0aA: [[PmWiki:CustomMarkupAlt|(alternate) Introduction to custom markup for Beginners]]%0a%0aQ: How do I make a rule that runs once at the end of all other rule processing?%0aA: Use this statement instead of the usual %25hlt php%25@@Markup()@@ call:%0a-->%25hlt php%25@@$MarkupFrameBase['posteval']['myfooter'] = "\$out = onetimerule(\$out);";@@%0a%0aCategory: [[!Markup]] +time=1724101183 diff --git a/wikilib.d/PmWiki.Functions b/wikilib.d/PmWiki.Functions index e307a623..3cc35992 100644 --- a/wikilib.d/PmWiki.Functions +++ b/wikilib.d/PmWiki.Functions @@ -1,9 +1,9 @@ -version=pmwiki-2.3.33 ordered=1 urlencoded=1 +version=pmwiki-2.3.36 ordered=1 urlencoded=1 author=Petko charset=UTF-8 -csum=fix hlt (+31) +csum=Markup() pattern needs to have "/" as delimiters. (+48) name=PmWiki.Functions -rev=204 +rev=205 targets=Cookbook.Functions,PmWiki.CustomMarkup,PmWiki.CustomActions,PmWiki.BasicVariables,PmWiki.LayoutVariables,PmWiki.Forms,PmWiki.SecurityVariables,Cookbook.PccfToPcfOverride,PmWiki.LinkVariables,PmWiki.OtherVariables,PmWiki.EditVariables,PmWiki.UploadVariables,PmWiki.Functions,PmWiki.Variables,PmWiki.Internationalizations,PmWiki.FmtPageName,PmWiki.MakeLink,PmWiki.ConditionalMarkup,PmWiki.Drafts,PmWiki.IncludeOtherPages,PmWiki.UpdatePage,Cookbook.MarkupExpressionSamples,Cookbook.ParseArgs,Category.PmWikiDeveloper,!PmWikiDeveloper -text=(:Summary: How some of the functions in pmwiki.php work:)%0a(:Audience: admins (advanced) :)%0a%0aThis page describes some of the internal workings of PmWiki by explaining how some of the functions in @@pmwiki.php@@ work. For a more brief list/overview on functions useful to for instance cookbook writers, see Cookbook:Functions. %0a%0aTo use this functions you have to make sure that all relevant internal variables have been initialized correctly. See [[Custom Markup]] and [[(PmWiki:)Custom Actions]] for more information on how these functions are typically called via %25hlt php%25[@Markup()@] or [@$HandleActions[]@].%0a%0a!! [[#PSFT]] PSFT()%0a%0a%25hlt php%25[@PSFT($format, $timestamp=null, $locale=null, $tz=null)@]%0a%0aThe %25hlt php%25@@PSFT()@@ function (''PmWiki String Format Time'', added in 2.3.0) is intended to be a safe replacement for the very widely used PHP functions @@[[https://www.php.net/strftime|strftime()]]@@ and @@[[https://www.php.net/gmstrftime|gmtstrftime()]]@@ which became deprecated in PHP 8.1.%0a%0aUnlike %25hlt php%25@@strftime()@@, @@PSFT()@@ accepts 2 additional arguments @@$locale@@ and @@$tz@@, which allow to set a different language or timezone.%0a%0aPmWiki 2.3.0 uses this function in all cases where it previously used %25hlt php%25@@strftime()@@, including the %25pmhlt%25[@{(ftime)}@] Markup Expression. If your local customizations and recipes use %25hlt php%25@@strftime()@@, you should be able to safely replace all calls to @@strftime()@@ with @@PSFT()@@, without changing the arguments. Any calls to @@gmtstrftime($fmt, $stamp)@@ can be replaced with @@PSFT($fmt, $stamp, null, 'GMT')@@.%0a%0aThe old functions were deprecated by the PHP developers because they behaved inconsistently on different platforms, and were dependent on installed system locales (i.e. a language would only work if the system had its locale installed). The new function uses the PHP class [[https://www.php.net/manual/en/class.intldateformatter.php|IntlDateFormatter]] and should be better. Unfortunately, it is not always enabled by hosting providers. %0a%0aSo depending on your installation, a specific language may be available with %25hlt php%25@@strftime()@@ and/or with @@IntlDateFormatter@@.%0a%0aIn addition, some rarely used shortcut percent-formats [@%25c, %25x, %25X@] also behave inconsistently on different platforms, and the new formatter may show a slightly different output. You can always replace these shortcut formats with the full formats you require.%0a%0aFor these reasons, %25hlt php%25@@PSFT()@@ is currently a compromise, by default reusing @@strftime()@@ for PHP 8.0 or earlier. Updating your calls from @@strftime()@@ shouldn't cause any changes in your outputs.%0a%0aYou can set in @@config.php@@ the variable %25hlt php%25@@$EnableFTimeNew = 1;@@ for @@PSFT()@@ to try using @@IntlDateFormatter@@ before PHP 8.1. If @@IntlDateFormatter@@ is not available, it will show the month and day names in English. Check what works.%0a%0aSince the %25hlt php%25@@strftime()@@ function is deprecated, it is unlikely for it to add new formats. We have added 2 custom formats:%0a* [@%25o@] for the "ordinal suffix" of the date, as "st" in "January 1st". If @@IntlDateFormatter@@ is not available, it will show the suffix in English%0a* [@%25L@] for a human-readable timestamp of the format %25pmhlt%25[@@2022-09-25T11:49:08Z@]%25%25 which will be displayed formatted either as $TimeFmt or in the local time zone of the visitor, see $EnableLocalTimes.%0a%0a(:include MarkupExpressions#ftimeformats#ftimeformatsend:)%0a%0a>>frame%3c%3c%0aA difference between %25hlt php%25@@strftime($format, $stamp)@@ and @@PSFT($format, $stamp)@@ is how they interpret a false, empty or non-numeric @@$stamp@@ argument.%0a|| class=simpletable%0a||! @@$stamp@@ argument ||! @@strftime($format, $stamp)@@ ||! @@PSFT($format, $stamp)@@ ||%0a|| numeric || the stamp || the stamp ||%0a|| missing or ''null'' || current time || current time ||%0a|| ''false'' || 1970-01-01 || current time ||%0a|| "" (empty string) \\%0aother non-numeric || 1970-01-01 or ''false'' (older PHP versions) \\%0a ''Warning: TypeError'' (PHP 7.4+) || current time ||%0aFor PmWiki, it seemed reasonable to make empty strings and other non-numeric values default to the current time. If your %25hlt php%25@@$stamp@@ variable may be empty or ''false'', and your recipes rely on @@strftime()@@ returning "1970-01-01", you can cast the stamp to integer:%0a%25hlt php%25[@%0a PSFT($format, intval($stamp));%0a@]%0a>>%3c%3c%0a%0a%0a!! [[#pmtoken]] pmtoken()%0a%25hlt php%25[@pmtoken($check = 0, $abort = false)@]%0a%0aThe %25hlt php%25@@pmtoken()@@ function sets or checks a unique session identifier to be used in input forms, with the goal of preventing cross-site request forgeries (CSRF).%0a%0aCalling %25hlt php%25@@pmtoken()@@ or @@pmtoken(0)@@ will create a token if it doesn't exist, store it in the @@$_SESSION@@ array, and return it. It will also set the variables [@$FmtV['$TokenValue']@] which can be used in HTML templates and [@$InputValues['pmtoken']@] to be used in markup [[forms]], although it may be simpler to use %25pmhlt%25[@(:input pmtoken:)@] instead.%0a%0aThe name of the input element, by default 'pmtoken', can be changed by setting for example %25hlt php%25[@$FmtV['$TokenName'] = 'CSRFtoken';@].%0a%0aCalling %25hlt php%25@@pmtoken(1)@@ will check the @@$_POST['pmtoken']@@ value and will return true if it is valid.%0a%0aCalling %25hlt php%25@@pmtoken(2)@@ will check the @@$_GET['pmtoken']@@ value and will return true if it is valid.%0a%0aCalling %25hlt php%25@@pmtoken(1, true)@@ or @@pmtoken(2, true)@@ with a second truthy argument, and the token is invalid, will directly call @@Abort()@@ and exit.%0a%0a%0a!! [[#pmcrypt]] pmcrypt()%0a%25hlt php%25[@pmcrypt($password, $salt = null)@]%0a%0aThe %25hlt php%25@@pmcrypt()@@ function is intended to be a safe replacement for the [[https://www.php.net/crypt|PHP 5.6+ crypt() function]] without providing a $salt, which would raise a notice. If a salt is provided, crypt() is called to check an existing password. If a salt is not provided, [[https://www.php.net/password_hash|password_hash()]] will be called to create a cryptographically strong password hash.%0a%0a!! [[#pmsetcookie]] pmsetcookie()%0a%25hlt php%25[@pmsetcookie($name, $val="", $exp=0, $path="", $dom="", $secure=null, $httponly=null)@]%0a%0aThis function is intended as a replacement for [[https://www.php.net/setcookie|setcookie()]]. It will automatically set the $secure and $httponly arguments if they are not set by the caller function and if $EnableCookieSecure and $EnableCookieHTTPOnly are enabled.%0a%0a!![[#PCCF]] PCCF() %25red%25 Deprecated since PHP 7.2%25%25%0a%25hlt php%25[@PCCF($php_code, $callback_template='default', $callback_arguments = '$m')@] %0a%0aThe %25hlt php%25@@PCCF()@@ function (''PmWiki Create Callback Function'') can be used to create callback functions used with [[https://www.php.net/preg_replace_callback|preg_replace_callback]]. It is required for PHP 5.5, but will also work with earlier PHP versions.%0a%0aThe first argument is the PHP code to be evaluated. %0a%0aThe second argument (optional) is the callback template, a key from the global @@$CallbackFnTemplates@@ array. There are two templates that can be used by recipe authors: %0a* 'default' will pass @@$php_code@@ as a function code%0a* 'return' will wrap @@$php_code@@ like "@@return $php_code;@@" (since PmWiki 2.2.62)%0a%0aThe third argument (optional) is the argument of the callback function. Note that PmWiki uses the '$m' argument to pass the matches of a regular expression search, but your function can use other argument(s).%0a%0a%25hlt php%25@@PCCF()@@ will create an anonymous (lambda) callback function containing the supplied code, and will cache it. On subsequent calls with the same @@$php_code@@, @@PCCF()@@ will return the cached function name.%0a%0aSee the [[https://www.php.net/create_function | PHP create function]].%0a%0a>>font-style=italic%3c%3c%0aPHP 7.2 deprecates %25hlt php%25@@create_function()@@ and future versions will remove it. If you need to migrate older code that used @@PCCF()@@, you can usually write regular functions and pass the function name where you previously passed the result of PCCF(). For example, suppose you had a pattern like this:%0a-> %25hlt php%25@@'/(?%3c=^| )([a-z])/' => PCCF("return strtoupper(\$m[1]);"),@@%0a%0aFor PHP 7.2 compatibility, you can write a callback function:%0a-> %25hlt php%25@@function @@%25green%25my_callback%25hlt php%25@@($m) { return strtoupper($m[1]); }@@%0a%0athen change the pattern to look like this:%0a-> %25hlt php%25@@'/(?%3c=^| )([a-z])/' => '%25green%25my_callback%25%25',@@%0a%0aSee also: the recipe [[(Cookbook:)PccfToPcfOverride]] allows existing recipes to run on PHP 7 without causing deprecated @@create_function()@@ messages.%0a>>%3c%3c%0a%0a!![[#PPRA]] PPRA()%0a%25hlt php%25[@PPRA($array_search_replace, $string)@]%0a%0aThe %25hlt php%25@@PPRA()@@ function (''PmWiki Preg Replace Array'') can be used to perform a regular expression replacement with or without evaluation, for PHP 5.5 compatibility. %0a%0aSince PmWiki 2.2.56, PmWiki uses this function to process the following arrays: $MakePageNamePatterns, $FmtP, $QualifyPatterns, $ROEPatterns, $ROSPatterns, $SaveAttrPatterns, $MakeUploadNamePatterns. Any custom settings should continue to work for PHP 5.4 and earlier, but wikis running on PHP 5.5 may need to make a few changes.%0a%0aThe first argument contains the 'search'=>'replace' pairs, the second is the "haystack" string to be manipulated.%0a%0aThe 'replace' parts of the array can be strings or function names. If the 'replace' part is a callable function name, it will be called with the array of matches as a first argument via %25hlt php%25@@preg_replace_callback()@@. If not a callable function, a simple @@preg_replace()@@ will be performed.%0a%0aPreviously, PmWiki used such constructs:%0a-> %25hlt php%25@@$fmt = preg_replace(array_keys($FmtP), array_values($FmtP), $fmt);@@%0a%0aIt is now possible to use simply this:%0a-> %25hlt php%25@@$fmt = PPRA($FmtP, $fmt);@@%0a%0aNote that since PHP 5.5, the search patterns cannot have an /e evaluation flag. When creating the $array_search_replace array, before PHP 5.5 we could use something like (eg. for $MakePageNamePatterns):%0a-> %25hlt php%25@@'/(?%3c=^| )([a-z])/e' => "strtoupper('$1')",@@%0a%0aSince PHP 5.5, we should use this (will also work in PHP 5.4 and earlier):%0a-> %25hlt php%25@@'/(?%3c=^| )([a-z])/' => PCCF("return strtoupper(\$m[1]);"),@@%0a%0aNote that the @@/e@@ flag should be now omitted, instead of @@'$0', '$1', '$2',@@ we should use @@$m[0], $m[1], $m[2],@@ etc. in the replacement code, and there is no need to call @@PSS()@@ in the replacement code, as backslashes are not automatically added.%0a%0a>>font-style=italic%3c%3c%0aFor PHP 7.2 and newer, instead of using %25hlt php%25@@PCCF()@@ to create anonymous functions, we add a real function in our add-on, and then pass the function name as the pattern replacement (see example at [[#PCCF|PCCF]], which will also work on PHP 4 and 5):%0a-> %25hlt php%25@@'/(?%3c=^| )([a-z])/' => '%25green%25my_callback%25%25',@@%0a>>%3c%3c%0a%0a!![[#PPRE]] PPRE() %25red%25 Deprecated since PHP 7.2%25%25%0a%25hlt php%25[@PPRE($search_pattern, $replacement_code, $string)@]%0a%0aThe %25hlt php%25@@PPRE()@@ function (''PmWiki Preg Replace Evaluate'') can be used to perform a regular expression replacement with evaluation.%0a%0aSince PHP 5.5, the %25hlt php%25@@preg_replace()@@ function has deprecated the /e evaluation flag, and displays warnings when the flag is used. The @@PPRE()@@ function automatically creates a callback function with the replacement code and calls it.%0a%0aBefore PHP 5.5, it was possible to use such calls:%0a-> %25hlt php%25@@$fmt = preg_replace('/\\$([A-Z]\\w*Fmt)\\b/e','$GLOBALS["$1"]',$fmt);@@%0a%0aSince PHP 5.5, it is possible to replace the previous snippet with the following (also works before PHP 5.5):%0a-> %25hlt php%25@@$fmt = PPRE('@@%25green%25/\\$([A-Z]\\w*Fmt)\\b/%25hlt php%25@@','$GLOBALS[$m[1]]',$fmt);@@%0a%0aNote that the @@/e@@ flag should be now omitted, instead of @@'$0', '$1', '$2',@@ we should use @@$m[0], $m[1], $m[2],@@ etc. in the replacement code, and there is no need to call @@PSS()@@ in the replacement code, as backslashes are not automatically added.%0a%0a>>font-style=italic%3c%3c%0aFor PHP 7.2 and newer, calling this function will raise "deprecated" notices. You need to rewrite your code to use [[https://www.php.net/preg_replace_callback|preg_replace_callback]], by moving the code into real functions:%0a%0a-> %25hlt php%25@@$fmt = preg_replace_callback('@@%25green%25/\\$([A-Z]\\w*Fmt)\\b/%25hlt php%25@@', 'my_global_var_callback',$fmt);@@%0a-> %25hlt php%25@@function my_global_var_callback($m) { return $GLOBALS[$m[1]]; }@@%0a%0ainstead of using %25hlt php%25@@PCCF()@@ to create anonymous functions, we add a real function in our add-on, and then pass the function name as the pattern replacement (see example at [[#PCCF|PCCF]], which will also work on PHP 4 and 5):%0a=> %25hlt php%25@@'/(?%3c=^| )([a-z])/' => '%25green%25my_callback%25%25',@@%0a>>%3c%3c%0a%0a(:if false:)(:comment Needs review and may change:)%0a!![[#PRCB]] PRCB()%0a%25hlt php%25[@PRCB($pat, $repl, $subj, $vars=null, $limit=-1, &$count=null, $flags=0)@]%0a%0aThe %25hlt php%25@@PRCB()@@ function (''PmWiki Regex Replace Callback'') makes it simple to pass variables to a named callback function with [[https://php.net/preg_replace_callback|preg_replace_callback()]].%0a%0aIf you need to use preg_replace_callback() and pass some variables to the callback function, you can do something like:%0a%0a%25hlt php%25[@$result = PRCB($patern, 'my_callback', $subject, $pagename);@]%0a%0aThen your function will be called this way: %25hlt php%25[@my_callback($matches, $pagename);@]. You can pass multiple variables with an array.%0a%0aThe function can also be used without passing variables, just shorter than @@preg_replace_callback()@@:%0a%0a%25hlt php%25[@$result = PRCB($patern, 'my_callback', $subject);@]%0a%0a(:ifend:)%0a%0a!![[#Qualify]] Qualify()%0a%25hlt php%25[@Qualify($pagename, $text)@]%0a%0a%25hlt php%25@@Qualify()@@ applies $QualifyPatterns to convert relative links and references into absolute equivalents.%0aThis function is called by usual wiki markups that include text from other pages.%0aIt will rewrite links like %25pmhlt%25[@[[Page]]@] into [@[[Group/Page]]@], and page (text) variables like [@{$Title}@] into [@{Group.Page$Title}@]%0aso that they work the same way in the source page and in the including page.%0aSee also $QualifyPatterns and %25pmhlt%25@@[[({$Name}#)RetrieveAuthSection]]()@@.%0a%0a%0a!![[#PHSC]] PHSC()%0a%25hlt php%25[@PHSC($string_or_array, $flags=ENT_COMPAT, $encoding=null, $double_encode=true)@]%0a%0aThe %25hlt php%25@@PHSC()@@ function (''PmWiki HTML Special Characters'') is a replacement for the PHP function [[https://www.php.net/htmlspecialchars|htmlspecialchars]]. %0a%0aThe %25hlt php%25@@htmlspecialchars()@@ function was modified since PHP 5.4 in two ways: it now requires a valid string for the supplied encoding, and it changes the default encoding to UTF-8. This can cause sections of the page to become blank/empty on many sites using the ISO-8859-1 encoding without having set the third argument ($encoding) when calling @@htmlspecialchars()@@.%0a%0aThe %25hlt php%25@@PHSC()@@ function calls @@htmlspecialchars()@@ with an 8-bit encoding as third argument, whatever the encoding of the wiki (unless you supply an encoding). This way the string never contains invalid characters.%0a%0aIt should be safe for recipe developers to replace all calls to %25hlt php%25@@htmlspecialchars()@@ with calls to @@PHSC()@@. Only the first argument is required when calling @@PHSC()@@, although authors may wish to call @@PHSC($string_or_array, ENT_QUOTES)@@.%0a%0aUnlike %25hlt php%25@@htmlspecialchars()@@, the @@PHSC()@@ function can process arrays recursively (only the values are converted, not the keys of the array).%0a%0a!![[#PSS]] PSS()%0a%25hlt php%25[@PSS($string)@]%0a%0aThe %25hlt php%25@@PSS()@@ function (''PmWiki Strip Slashes'') removes the backslashes that are automatically inserted in front of quotation marks by the /e option of PHP's preg_replace function. @@PSS()@@ is%0amost commonly used in replacement arguments to @@Markup()@@, when the pattern specifies /e and one or more of the parenthesized subpatterns could contain a quote or backslash. %0a("PSS" stands for "PmWiki Strip Slashes".)%0a->From PM: PmWiki expects %25hlt php%25@@PSS()@@ to always occur inside of double-quoted strings and to contain single quoted strings internally. The reason for this is that we don't want the @@$1@@ or @@$2@@ to accidentally contain characters that would then be interpreted inside of the double-quoted string when the PSS is evaluated.%0a-->%25hlt php%25@@Markup('foo', 'inline', '/(something)/e', 'Foo(PSS("$1"))'); # wrong@@%0a-->%25hlt php%25@@Markup('foo', 'inline', '/(something)/e', "Foo(PSS('$1'))"); # right@@%0a%0a%25note%25 Note, the extra slashes are only added by %25hlt php%25@@preg_replace()@@ with an @@/e@@ modifier. The markup definitions with @@Markup_e()@@ do NOT need to use @@PSS()@@ in the replacement strings. The new-type markup definitions with @@Markup()@@ and a simple function name as a replacement do NOT need to use @@PSS()@@ inside the replacement function. If you migrate old markup rules to the new format, delete the @@PSS()@@ calls.%0a%0a!!! Example %25block notoc%25%0aThis is a fictitious example where %25hlt php%25@@PSS()@@ should be used.%0aLet us assume that you wish to define a directive %25pmhlt%25[@(:example:)@]%0asuch that %25pmhlt%25[@(:example "A horse":)@] results in the HTML%0a-> %25hlt html%25[@%3cdiv>"A horse"%3c/div>@].%0aHere is how the markup rule can be created:%0a-> %25hlt php%25[@%0aMarkup('example', 'directives',%0a '/\\(:example\\s(.*?):\\)/e',%0a "Keep('%3cdiv>'.PSS('$1').'%3c/div>')");%0a@]%0aWe need to use %25hlt php%25@@PSS()@@ around the '@@$1@@' because the matched text could contain quotation marks, and the @@/e@@ will add backslashes in front of them.%0a%0a!![[#stripmagic]] stripmagic()%0a%25hlt php%25[@stripmagic($string)@]%0a%0aThis function should be used when processing the contents of %25hlt php%25[@$_POST@] or [@$_GET@] variables when they could contain quotes or backslashes. It verifies [@get_magic_quotes()@], if true, strips the automatically inserted escapes from the string.%0a%0aThe function can process arrays recursively (only the values are processed).%0a%0a!![[#FmtPageName]] FmtPageName()%0a%0a%25hlt php%25[@FmtPageName($fmt, $pagename)@]%0a%0a[[#FmtPageName-desc]]Returns %25hlt php%25[@$fmt@], with @@$variable@@ and [=$[internationalisation]=] substitutions performed, under the assumption that the current page is [@pagename@]. See [[PmWiki.Variables]] for an (incomplete) list of available variables, [[PmWiki.Internationalizations]] for internationalisation. Security: not to be run on user-supplied data.%0a%0aThis is one of the major functions in PmWiki, see [[PmWiki.FmtPageName]] for%0alots of details.%0a%0a%0a!![[#Markup]] Markup()%0a%25hlt php%25[@Markup($name, $when, $pattern, $replace)@]%0a%0a[[#Markup-desc]]Adds a new markup to the conversion table. Described in greater detail at [[PmWiki.CustomMarkup]].%0a%0aThis function is used to insert translation rules into the PmWiki's translation engine. The arguments to %25hlt php%25[@Markup()@] are all strings, where:%0a%0a:%25hlt php%25[@$name@]: The string names the rule that is inserted. If a rule of the same name already exists, then this rule is ignored.%0a:%25hlt php%25[@$when@]: This string is used to control ''when'' a rule is to be applied relative to other rules. A specification of "[@%3cxyz@]" says to apply this rule prior to the rule named "xyz", while "[@>xyz@]" says to apply this rule after the rule "xyz". See [[(PmWiki:)CustomMarkup]] for more details on the order of rules.%0a:%25hlt php%25[@$pattern@]: This string is a [[regular expression -> https://www.php.net/preg_replace]] that is used by the translation engine to look for occurrences of this rule in the markup source.%0a:%25hlt php%25[@$replace@]: This string will replace the matched text when a match occurs, or the function name that will return the replacement text.%0a%0aAlso see: [[PmWiki.CustomMarkup]] and [[Cookbook:Functions#Markup]]%0a%0a!![[#MarkupToHTML]] MarkupToHTML()%0a%0a%25hlt php%25[@MarkupToHTML($pagename, $str)@]%0a%0a[[#MarkupToHTML-desc]] Converts the string %25hlt php%25[@$str@] containing PmWiki markup into the corresponding HTML code, assuming the current page is [@$pagename@].%0a%25hlt php%25@@MarkupToHTML()@@ replaces @@\n\n@@ sequences by @@%3c:vspace>@@ first thing when text is passed to it. Subsequently @@%3c:vspace>@@ is processed by the markup rules:%0a-> '@@!vspace@@' removes @@%3c:vspace>@@ after headings.%0a-> '@@%3cvspace>%3cp>@@' replaces @@%3c:vspace>%3cp>@@ with @@%3cp class='vspace'>@@%0a-> '@@%3cvspace>@@' replaces %3c:vspace> with @@%3cdiv class='vspace'>@@%0a-> and finally%0a-> '@@^%3c:@@' removes any remaining @@%3c:vspace>@@, mostly from restored [=[=]=escaped text=].%0a%0aAlso see: [[Cookbook:Functions#MarkupToHTML]]%0a%0a!![[#mkdirp]] mkdirp()%0a%25hlt php%25[@mkdirp($dir)@]%0a%0aThe function %25hlt php%25[@mkdirp($dir)@] creates a directory, [@$dir@], if it doesn't already exist, including any parent directories that might be needed. For each directory created, it checks that the permissions on the directory are sufficient to allow PmWiki scripts to read and write files in that directory. This includes checking for restrictions imposed by PHP's safe_mode setting. If [@mkdirp()@] is unable to successfully create a read/write directory, [@mkdirp()@] aborts with an error message telling the administrator the steps to take to either create @@$dir@@ manually or give PmWiki sufficient permissions to be able to do it.%0a%0a!![[#Lock]] Lock()%0a%25hlt php%25[@Lock(0)@]%0a%0aThis function is used to make sure only one instance of PmWiki is running when files are being written. It does not "lock pages" for editing.%0a%0aFrom a recipe, use:%0a* %25hlt php%25[@Lock(2);@] to acquire an ''exclusive'' lock, so that no other PHP processes can modify files. This can be used when your function is writing files on the server.%0a* %25hlt php%25[@Lock(1);@] to acquire a ''shared'' lock. This may be used when your function is reading files from the server, in case another process is writing them at the same time.%0a* %25hlt php%25[@Lock(0);@] to ''release'' a previous exclusive or shared lock. Use this immediately after your function finishes reading or writing the files.%0a%0aIf you don't release an acquired lock, it should be automatically released at the end of the processing.%0a%0a%0a!![[#MakeLink]] MakeLink()%0a%25hlt php%25[@MakeLink($pagename, $target, $txt, $suffix, $fmt)@]%0a%0aThe function %25hlt php%25[@MakeLink($pagename, $target, $txt, $suffix, $fmt)@] returns an html-formatted anchor link. Its arguments are as follows:%0a $pagename is the source page%0a $target is where the link should go%0a $txt is the value to use for '$LinkText' in the output %0a $suffix is any suffix string to be added to $txt%0a $fmt is a format string to use%0a%0aIf $txt is NULL or not specified, then it is automatically computed from $target.%0a%0aIf $fmt is NULL or not specified, then MakeLink uses the default%0aformat as specified by the type of link. For page links this%0ameans the $LinkPageExistsFmt and $LinkPageCreateFmt variables,%0afor intermap-style links it comes from either the $IMapLinkFmt%0aarray or from $UrlLinkFmt. Inside of the formatting strings,%0a$LinkUrl is replaced by the resolved url for the link, $LinkText%0ais replaced with the appropriate text, and $LinkAlt is replaced%0aby any "title" (alternate text) information associated with the%0alink.%0a%0aAlso see: [[PmWiki:MakeLink]] and [[Cookbook:Functions#MakeLink]]%0a%0a!![[#MakeUploadName]] MakeUploadName()%0a%25hlt php%25@@MakeUploadName($pagename, $x)@@%0a%0a%25hlt php%25@@MakeUploadName()@@ simply takes a string @@$x@@ (representing an attachment's%0aname) and converts it to a valid name by removing any unwanted characters.%0aIt also requires the name to begin and end with an alphanumeric character,%0aand as of 2.0.beta28 it forces any file extensions to lowercase.%0aThis function is defined in @@scripts/upload.php@@ and only used when uploads%0aare enabled.%0a%0a!![[#DownloadUrl]] DownloadUrl()%0a%25hlt php%25@@DownloadUrl($pagename, $path)@@%0a%0aThis function returns the public URL of an attached file. The arguments are as follow:%0a* $pagename - the currently processed page%0a* %25hlt php%25@@$path@@ - the file path, as in @@file.ext@@ or @@OtherPage/file.ext@@ or @@Group/OtherPage/file.ext@@%0a%0aIf the file doesn't exist, the function returns false. The global variable %25hlt php%25@@$FmtV['$LinkUpload']@@ contains the URL to the upload form, for a file with such a name to be attached. The global variable %25hlt php%25@@$FmtV['$LinkDownload']@@ contains the URL to the file, as if it were uploaded to the wiki.%0a%0aThe function calls [[#MakeUploadName|%25hlt php%25@@MakeUploadName()@@]] on the @@$path@@ argument so you don't need to do it before calling it.%0a%0aThe returned URL respects $UploadPrefixFmt and $EnableDirectDownload of the wiki.%0a%0a%0a!![[#SessionAuth]] SessionAuth()%0a%25hlt php%25[@SessionAuth($pagename, $auth=NULL)@]%0a%0a%25hlt php%25@@SessionAuth()@@ manages keeping authentication via cookie-sessions. Session contains every password or validated id and associated groups from previous calls. It adds elements passed by @@$auth@@ to session. It also writes every element saved in session to @@$AuthPw(passwords)@@ and @@$AuthList(ids and groups)@@.%0a%0a!![[#IsAuthorized]] IsAuthorized()%0a%25hlt php%25[@IsAuthorized($chal, $source, &$from)@]%0a%0a%25hlt php%25@@IsAuthorized()@@ takes a pageattributesstring (e. g. "id:user1 $1$Ff3w34HASH...") in @@$chal@@.%0a%0a%25hlt php%25@@$source@@ is simply returned and used for building the authcascade (pageattributes - groupattributes - @@$DefaultPassword@@).%0a%0a%25hlt php%25@@$from@@ will be returned if @@$chal@@ is empty, because it is not checked before calling @@IsAuthorized()@@, this is needed for the authcascade. %0a%25hlt php%25@@IsAuthorized()@@ returns an array with three values: @@$auth@@ @@1@@ - authenticated, @@0@@ - not authenticated, @@-1@@ - refused; @@$passwd@@; @@$source@@ from the parameter list.%0a%0a!![[#CondAuth]] CondAuth()%0a%25hlt php%25[@CondAuth($pagename, 'auth level')@]%0a%0a%25hlt php%25[@CondAuth()@]%25%25 implements the [[ConditionalMarkup]] for %25pmhlt%25[@(:if auth level:)@]%25%25. For instance %25hlt php%25[@ CondAuth($pagename,'edit')@]%25%25 is true if authorization level is 'edit'. Use inside local configuration files to build conditionals with a check of authorization level, similar to using %25pmhlt%25[@(:if auth level:)@]%25%25 on a wiki page.%0a%0aNote that %25hlt php%25@@CondAuth()@@ should be called after all authorization levels and passwords have been defined. For example, if you use it with [[Drafts]], you should include the @@draft.php@@ script before calling @@CondAuth()@@:%0a%25hlt php%25[@%0a $EnableDrafts = 1;%0a $DefaultPasswords['publish'] = pmcrypt('secret');%0a include_once("$FarmD/scripts/draft.php");%0a if (! CondAuth($pagename, 'edit')) { /* whatever */ }%0a@]%0aBest is to use %25hlt php%25@@CondAuth()@@ near the bottom of your @@config.php@@ script.%0a%0a!! [[#RetrieveAuthPage]] RetrieveAuthPage()%0a%25hlt php%25@@RetrieveAuthPage($pagename, $level, $authprompt=true, $since=0)@@%0a%0aPm words as said in https://www.pmwiki.org/pipermail/pmwiki-users/2005-April/012804.html %0awhere:%0a%0a $pagename - name of page to be read%0a $level - authorization level required (read/edit/auth/upload)%0a $authprompt - true if user should be prompted for a password if needed%0a $since - how much of the page history to read%0a 0 == read entire page including all of history%0a READPAGE_CURRENT == read page without loading history%0a timestamp == read history only back through timestamp%0a%0aThe @@$since@@ parameter allows PmWiki to stop reading from a page file%0aas soon as it has whatever information is needed -- i.e., if an operation%0asuch as browsing isn't going to need the page's history, then specifying%0aREADPAGE_CURRENT can result in a much faster loading time. (This can be %0aespecially important for things such as searching and page listings.)%0aHowever, if combined with %25hlt php%25@@UpdatePage()@@, the updated page will have no history.%0a%0aUse e.g. %25hlt php%25[@$page = @RetrieveAuthPage('Main.MyPage', 'read')@] to obtain a page object that contains all the information of the correspondent file in separate keys, e.g. [@$page['text']@] will contain a string with the current wiki markup of Main.MyPage. Use this generally in preference to the alternative function [@ReadPage($pagename, $since=0)@] since it respects the authorisation of the user, i.e. it checks the authorisation level before loading the page, or it can be set to do so. [@ReadPage()@] reads a page regardless of permission.%0a%0aPassing 'ALWAYS' as the authorization level (instead of 'read', 'edit', etc.) will cause %25hlt php%25@@RetrieveAuthPage()@@ to always read and return the page, even if it happens to be protected by a read password.%0a%0a%0a!! [[#RetrieveAuthSection]] RetrieveAuthSection()%0a%25hlt php%25@@RetrieveAuthSection($pagename, $pagesection, $list=NULL, $auth='read')@@%0a%0a%25hlt php%25@@RetrieveAuthSection()@@ extracts a section of text from a page. If @@$pagesection@@ starts with anything other than '@@#@@', the text before the first '@@#@@' (or all of it, if there is no '@@#@@') identifies the page to extract text from. Otherwise @@RetrieveAuthSection()@@ looks in the pages given by @@$list@@ (should be an array), or in @@$pagename@@ if @@$list@@ is not specified. %0a* The selected page is placed in the global @@$RASPageName@@ variable. %0a* The caller is responsible for calling %25hlt php%25@@Qualify()@@ as needed, i.e. if you need to control how unqualified page and variable names shall be resolved.%0a** To have them act as in the original text, let %25hlt php%25@@Qualify()@@ resolve them relative to the source page.%0a** If the imported text was not meant as wikitext but as some other kind of markup that might happen to contain double pairs of square brackets, (:comment %3c-- not: pairs of 〚double square brackets〛 = U+301A/U+301B:) or dollar signs inside curly brackets, you probably don't want to %25hlt php%25@@Qualify()@@ them. If you output them into wikitext, you'll probably need to @@Keep()@@ the text (:comment %3c-- translators: conceptually this means to have Keep() pack the text in a container that marks it as "final".:) (in case of HTML, XML, RSS or similar output, @@PHSC()@@ first!), to prevent later stages of processing from interpreting the apparent wiki markups in context of the target page.%0a** If your code produces wikitext for an auxiliary page that is meant to be included by another page higher up in the inclusion chain, and want links and variables to work as if they were in the auxiliary page, use the auxiliary page's "GroupName.PageName" as the $pagename argument for %25hlt php%25@@Qualify()@@.%0a%0aProvides a way to limit the array that is returned by ReadPage, so that it only pulls the content up to a specific section marker. For example, pulling from start of page to '##blogend':%0a->%25hlt php%25[@%0afunction FeedText($pagename, &$page, $tag) {%0a $text = RetrieveAuthSection($pagename, '##blogend');%0a $content = MarkupToHTML($pagename, $text);%0a return "%3c$tag>%3c![CDATA[$content]]>%3c/$tag>";%0a}%0a@]%0a%0aThe '##blogend' argument says to read from the beginning of the page to just before the line containing the [[#blogend]] marker. See%0a[[PmWiki:IncludeOtherPages | IncludeOtherPages]] for more information about the section specifications.%0a%0aThis version won't read text from pages that are read-protected; if you want to get text even from read-protected pages, then %0a->%25hlt php%25[@%0a $text = RetrieveAuthSection($pagename, '##blogend', NULL, 'ALWAYS');%0a@]%0a%0a%0a!! [[#UpdatePage]] UpdatePage()%0a%25hlt php%25@@UpdatePage($pagename, $old (page object), $new (page object));@@%0a%0a''[[PmWiki:UpdatePage|More Technical Notes]]''%0a%0a%25hlt php%25[@UpdatePage()@] allows cookbook recipes to mimic the behavior of editing wiki pages via the browser. Internally, PmWiki does several housekeeping tasks which are accessible via this function (preserving history/diff information, updating page revision numbers, updating RecentChanges pages, sending email notifications, etc._%0a* "Page object" refers to an array pulled from %25hlt php%25[@RetrieveAuthPage($pagename, $level, $authprompt=true, $since=0);@] (preferred), or [@ReadPage($pagename); @] (disregards page security). Note that @@$new['text']@@ should contain all page data for the new version of the page. %0a* If a page doesn't exist, %25hlt php%25@@UpdatePage()@@ will attempt to create it.%0a* Ignoring @@$old@@ (e.g. %25hlt php%25[@UpdatePage($pagename, '', $new);@]) will erase all historical page data---a ''tabula rasa''.%0a** If you retrieved @@$old@@ using %25hlt php%25@@RetrieveAuthPage($pagename,$auth,$prompt,READPAGE_CURRENT)@@ and set @@$new=$old@@, then @@UpdatePage()@@ will also erase all historical data%0a%25hlt php%25@@UpdatePage()@@ cannot be called directly from @@config.php@@ because there are necessary initializations which occur later in @@pmwiki.php@@. It is not enough to just load @@stdconfig.php@@. If you want to use @@UpdatePage()@@ you will need to do it within a [[PmWiki:CustomMarkup | custom markup]], a [[Cookbook:MarkupExpressionSamples | custom markup expression]], or a [[PmWiki:CustomActions | custom action]].%0a%0a%0a!! [[#InsertEditFunction]] InsertEditFunction()%0a%25hlt php%25@@InsertEditFunction($newfn, $where='%3cPostPage')@@%0a%0aThis function makes it easy for recipe authors to insert a custom function in a specific position of the processing, see $EditFunctions and [[#UpdatePage|UpdatePage()]]. %0a%0aThe first argument is the name of the new function.%0a%0aThe second argument is the position where to place the new function, related to other edit functions? It can be:%0a* @@"%3c"@@ at the start, before the first edit function%0a* @@">"@@ at the end, after the last edit function%0a* @@"%3cExistingEditFunction"@@ before a specified edit function%0a* @@">ExistingEditFunction"@@ after a specified edit function%0a%0aThe function will return ''true'' on success, and ''false'' on failure (when the specified position or existing function was not recognized).%0a%0a!! [[#DisableSkinParts]] DisableSkinParts()%0a%25hlt php%25@@DisableSkinParts('parts to disable');@@%0a%0aThis function allows easy disabling of the skin sections header, footer, title, actions, and sidebars, like the corresponding directives %25pmhlt%25@@[=(:notitle:) (:noleft:)=]@@ etc. In your function, use something like:%0a->%25hlt php%25[@%0a DisableSkinParts('Left Header Footer Action Title');%0a@]%0a%0a!! [[#ParseArgs]] ParseArgs()%0aSee Cookbook:ParseArgs. %0a%0a!! [[#Redirect]] Redirect()%0a%0a!! [[#PageIndexTerms]] PageIndexTerms()%0a%0a!! [[#AsSpaced]] AsSpacedUTF8(), AsSpaced()%0a>>hlt php%3c%3c%0a@@AsSpaced()@@ is declared in @@pmwiki.php@@ \\%0a@@AsSpaced()@@ converts a string with WikiWords into a spaced version of that string.%0aIt can be overridden via $AsSpacedFunction, as it is in @@AsSpacedUTF8()@@. \\%0a@@AsSpacedUTF8()@@ is declared in the @@xlpage-utf-8.php@@ script.%0a>>%3c%3c%0a%0aCategories: [[!PmWiki Developer]] -time=1715681109 +text=(:Summary: How some of the functions in pmwiki.php work:)%0a(:Audience: admins (advanced) :)%0a%0aThis page describes some of the internal workings of PmWiki by explaining how some of the functions in @@pmwiki.php@@ work. For a more brief list/overview on functions useful to for instance cookbook writers, see Cookbook:Functions. %0a%0aTo use this functions you have to make sure that all relevant internal variables have been initialized correctly. See [[Custom Markup]] and [[(PmWiki:)Custom Actions]] for more information on how these functions are typically called via %25hlt php%25[@Markup()@] or [@$HandleActions[]@].%0a%0a!! [[#PSFT]] PSFT()%0a%0a%25hlt php%25[@PSFT($format, $timestamp=null, $locale=null, $tz=null)@]%0a%0aThe %25hlt php%25@@PSFT()@@ function (''PmWiki String Format Time'', added in 2.3.0) is intended to be a safe replacement for the very widely used PHP functions @@[[https://www.php.net/strftime|strftime()]]@@ and @@[[https://www.php.net/gmstrftime|gmtstrftime()]]@@ which became deprecated in PHP 8.1.%0a%0aUnlike %25hlt php%25@@strftime()@@, @@PSFT()@@ accepts 2 additional arguments @@$locale@@ and @@$tz@@, which allow to set a different language or timezone.%0a%0aPmWiki 2.3.0 uses this function in all cases where it previously used %25hlt php%25@@strftime()@@, including the %25pmhlt%25[@{(ftime)}@] Markup Expression. If your local customizations and recipes use %25hlt php%25@@strftime()@@, you should be able to safely replace all calls to @@strftime()@@ with @@PSFT()@@, without changing the arguments. Any calls to @@gmtstrftime($fmt, $stamp)@@ can be replaced with @@PSFT($fmt, $stamp, null, 'GMT')@@.%0a%0aThe old functions were deprecated by the PHP developers because they behaved inconsistently on different platforms, and were dependent on installed system locales (i.e. a language would only work if the system had its locale installed). The new function uses the PHP class [[https://www.php.net/manual/en/class.intldateformatter.php|IntlDateFormatter]] and should be better. Unfortunately, it is not always enabled by hosting providers. %0a%0aSo depending on your installation, a specific language may be available with %25hlt php%25@@strftime()@@ and/or with @@IntlDateFormatter@@.%0a%0aIn addition, some rarely used shortcut percent-formats [@%25c, %25x, %25X@] also behave inconsistently on different platforms, and the new formatter may show a slightly different output. You can always replace these shortcut formats with the full formats you require.%0a%0aFor these reasons, %25hlt php%25@@PSFT()@@ is currently a compromise, by default reusing @@strftime()@@ for PHP 8.0 or earlier. Updating your calls from @@strftime()@@ shouldn't cause any changes in your outputs.%0a%0aYou can set in @@config.php@@ the variable %25hlt php%25@@$EnableFTimeNew = 1;@@ for @@PSFT()@@ to try using @@IntlDateFormatter@@ before PHP 8.1. If @@IntlDateFormatter@@ is not available, it will show the month and day names in English. Check what works.%0a%0aSince the %25hlt php%25@@strftime()@@ function is deprecated, it is unlikely for it to add new formats. We have added 2 custom formats:%0a* [@%25o@] for the "ordinal suffix" of the date, as "st" in "January 1st". If @@IntlDateFormatter@@ is not available, it will show the suffix in English%0a* [@%25L@] for a human-readable timestamp of the format %25pmhlt%25[@@2022-09-25T11:49:08Z@]%25%25 which will be displayed formatted either as $TimeFmt or in the local time zone of the visitor, see $EnableLocalTimes.%0a%0a(:include MarkupExpressions#ftimeformats#ftimeformatsend:)%0a%0a>>frame%3c%3c%0aA difference between %25hlt php%25@@strftime($format, $stamp)@@ and @@PSFT($format, $stamp)@@ is how they interpret a false, empty or non-numeric @@$stamp@@ argument.%0a|| class=simpletable%0a||! @@$stamp@@ argument ||! @@strftime($format, $stamp)@@ ||! @@PSFT($format, $stamp)@@ ||%0a|| numeric || the stamp || the stamp ||%0a|| missing or ''null'' || current time || current time ||%0a|| ''false'' || 1970-01-01 || current time ||%0a|| "" (empty string) \\%0aother non-numeric || 1970-01-01 or ''false'' (older PHP versions) \\%0a ''Warning: TypeError'' (PHP 7.4+) || current time ||%0aFor PmWiki, it seemed reasonable to make empty strings and other non-numeric values default to the current time. If your %25hlt php%25@@$stamp@@ variable may be empty or ''false'', and your recipes rely on @@strftime()@@ returning "1970-01-01", you can cast the stamp to integer:%0a%25hlt php%25[@%0a PSFT($format, intval($stamp));%0a@]%0a>>%3c%3c%0a%0a%0a!! [[#pmtoken]] pmtoken()%0a%25hlt php%25[@pmtoken($check = 0, $abort = false)@]%0a%0aThe %25hlt php%25@@pmtoken()@@ function sets or checks a unique session identifier to be used in input forms, with the goal of preventing cross-site request forgeries (CSRF).%0a%0aCalling %25hlt php%25@@pmtoken()@@ or @@pmtoken(0)@@ will create a token if it doesn't exist, store it in the @@$_SESSION@@ array, and return it. It will also set the variables [@$FmtV['$TokenValue']@] which can be used in HTML templates and [@$InputValues['pmtoken']@] to be used in markup [[forms]], although it may be simpler to use %25pmhlt%25[@(:input pmtoken:)@] instead.%0a%0aThe name of the input element, by default 'pmtoken', can be changed by setting for example %25hlt php%25[@$FmtV['$TokenName'] = 'CSRFtoken';@].%0a%0aCalling %25hlt php%25@@pmtoken(1)@@ will check the @@$_POST['pmtoken']@@ value and will return true if it is valid.%0a%0aCalling %25hlt php%25@@pmtoken(2)@@ will check the @@$_GET['pmtoken']@@ value and will return true if it is valid.%0a%0aCalling %25hlt php%25@@pmtoken(1, true)@@ or @@pmtoken(2, true)@@ with a second truthy argument, and the token is invalid, will directly call @@Abort()@@ and exit.%0a%0a%0a!! [[#pmcrypt]] pmcrypt()%0a%25hlt php%25[@pmcrypt($password, $salt = null)@]%0a%0aThe %25hlt php%25@@pmcrypt()@@ function is intended to be a safe replacement for the [[https://www.php.net/crypt|PHP 5.6+ crypt() function]] without providing a $salt, which would raise a notice. If a salt is provided, crypt() is called to check an existing password. If a salt is not provided, [[https://www.php.net/password_hash|password_hash()]] will be called to create a cryptographically strong password hash.%0a%0a!! [[#pmsetcookie]] pmsetcookie()%0a%25hlt php%25[@pmsetcookie($name, $val="", $exp=0, $path="", $dom="", $secure=null, $httponly=null)@]%0a%0aThis function is intended as a replacement for [[https://www.php.net/setcookie|setcookie()]]. It will automatically set the $secure and $httponly arguments if they are not set by the caller function and if $EnableCookieSecure and $EnableCookieHTTPOnly are enabled.%0a%0a!![[#PCCF]] PCCF() %25red%25 Deprecated since PHP 7.2%25%25%0a%25hlt php%25[@PCCF($php_code, $callback_template='default', $callback_arguments = '$m')@] %0a%0aThe %25hlt php%25@@PCCF()@@ function (''PmWiki Create Callback Function'') can be used to create callback functions used with [[https://www.php.net/preg_replace_callback|preg_replace_callback]]. It is required for PHP 5.5, but will also work with earlier PHP versions.%0a%0aThe first argument is the PHP code to be evaluated. %0a%0aThe second argument (optional) is the callback template, a key from the global @@$CallbackFnTemplates@@ array. There are two templates that can be used by recipe authors: %0a* 'default' will pass @@$php_code@@ as a function code%0a* 'return' will wrap @@$php_code@@ like "@@return $php_code;@@" (since PmWiki 2.2.62)%0a%0aThe third argument (optional) is the argument of the callback function. Note that PmWiki uses the '$m' argument to pass the matches of a regular expression search, but your function can use other argument(s).%0a%0a%25hlt php%25@@PCCF()@@ will create an anonymous (lambda) callback function containing the supplied code, and will cache it. On subsequent calls with the same @@$php_code@@, @@PCCF()@@ will return the cached function name.%0a%0aSee the [[https://www.php.net/create_function | PHP create function]].%0a%0a>>font-style=italic%3c%3c%0aPHP 7.2 deprecates %25hlt php%25@@create_function()@@ and future versions will remove it. If you need to migrate older code that used @@PCCF()@@, you can usually write regular functions and pass the function name where you previously passed the result of PCCF(). For example, suppose you had a pattern like this:%0a-> %25hlt php%25@@'/(?%3c=^| )([a-z])/' => PCCF("return strtoupper(\$m[1]);"),@@%0a%0aFor PHP 7.2 compatibility, you can write a callback function:%0a-> %25hlt php%25@@function @@%25green%25my_callback%25hlt php%25@@($m) { return strtoupper($m[1]); }@@%0a%0athen change the pattern to look like this:%0a-> %25hlt php%25@@'/(?%3c=^| )([a-z])/' => '%25green%25my_callback%25%25',@@%0a%0aSee also: the recipe [[(Cookbook:)PccfToPcfOverride]] allows existing recipes to run on PHP 7 without causing deprecated @@create_function()@@ messages.%0a>>%3c%3c%0a%0a!![[#PPRA]] PPRA()%0a%25hlt php%25[@PPRA($array_search_replace, $string)@]%0a%0aThe %25hlt php%25@@PPRA()@@ function (''PmWiki Preg Replace Array'') can be used to perform a regular expression replacement with or without evaluation, for PHP 5.5 compatibility. %0a%0aSince PmWiki 2.2.56, PmWiki uses this function to process the following arrays: $MakePageNamePatterns, $FmtP, $QualifyPatterns, $ROEPatterns, $ROSPatterns, $SaveAttrPatterns, $MakeUploadNamePatterns. Any custom settings should continue to work for PHP 5.4 and earlier, but wikis running on PHP 5.5 may need to make a few changes.%0a%0aThe first argument contains the 'search'=>'replace' pairs, the second is the "haystack" string to be manipulated.%0a%0aThe 'replace' parts of the array can be strings or function names. If the 'replace' part is a callable function name, it will be called with the array of matches as a first argument via %25hlt php%25@@preg_replace_callback()@@. If not a callable function, a simple @@preg_replace()@@ will be performed.%0a%0aPreviously, PmWiki used such constructs:%0a-> %25hlt php%25@@$fmt = preg_replace(array_keys($FmtP), array_values($FmtP), $fmt);@@%0a%0aIt is now possible to use simply this:%0a-> %25hlt php%25@@$fmt = PPRA($FmtP, $fmt);@@%0a%0aNote that since PHP 5.5, the search patterns cannot have an /e evaluation flag. When creating the $array_search_replace array, before PHP 5.5 we could use something like (eg. for $MakePageNamePatterns):%0a-> %25hlt php%25@@'/(?%3c=^| )([a-z])/e' => "strtoupper('$1')",@@%0a%0aSince PHP 5.5, we should use this (will also work in PHP 5.4 and earlier):%0a-> %25hlt php%25@@'/(?%3c=^| )([a-z])/' => PCCF("return strtoupper(\$m[1]);"),@@%0a%0aNote that the @@/e@@ flag should be now omitted, instead of @@'$0', '$1', '$2',@@ we should use @@$m[0], $m[1], $m[2],@@ etc. in the replacement code, and there is no need to call @@PSS()@@ in the replacement code, as backslashes are not automatically added.%0a%0a>>font-style=italic%3c%3c%0aFor PHP 7.2 and newer, instead of using %25hlt php%25@@PCCF()@@ to create anonymous functions, we add a real function in our add-on, and then pass the function name as the pattern replacement (see example at [[#PCCF|PCCF]], which will also work on PHP 4 and 5):%0a-> %25hlt php%25@@'/(?%3c=^| )([a-z])/' => '%25green%25my_callback%25%25',@@%0a>>%3c%3c%0a%0a!![[#PPRE]] PPRE() %25red%25 Deprecated since PHP 7.2%25%25%0a%25hlt php%25[@PPRE($search_pattern, $replacement_code, $string)@]%0a%0aThe %25hlt php%25@@PPRE()@@ function (''PmWiki Preg Replace Evaluate'') can be used to perform a regular expression replacement with evaluation.%0a%0aSince PHP 5.5, the %25hlt php%25@@preg_replace()@@ function has deprecated the /e evaluation flag, and displays warnings when the flag is used. The @@PPRE()@@ function automatically creates a callback function with the replacement code and calls it.%0a%0aBefore PHP 5.5, it was possible to use such calls:%0a-> %25hlt php%25@@$fmt = preg_replace('/\\$([A-Z]\\w*Fmt)\\b/e','$GLOBALS["$1"]',$fmt);@@%0a%0aSince PHP 5.5, it is possible to replace the previous snippet with the following (also works before PHP 5.5):%0a-> %25hlt php%25@@$fmt = PPRE('@@%25green%25/\\$([A-Z]\\w*Fmt)\\b/%25hlt php%25@@','$GLOBALS[$m[1]]',$fmt);@@%0a%0aNote that the @@/e@@ flag should be now omitted, instead of @@'$0', '$1', '$2',@@ we should use @@$m[0], $m[1], $m[2],@@ etc. in the replacement code, and there is no need to call @@PSS()@@ in the replacement code, as backslashes are not automatically added.%0a%0a>>font-style=italic%3c%3c%0aFor PHP 7.2 and newer, calling this function will raise "deprecated" notices. You need to rewrite your code to use [[https://www.php.net/preg_replace_callback|preg_replace_callback]], by moving the code into real functions:%0a%0a-> %25hlt php%25@@$fmt = preg_replace_callback('@@%25green%25/\\$([A-Z]\\w*Fmt)\\b/%25hlt php%25@@', 'my_global_var_callback',$fmt);@@%0a-> %25hlt php%25@@function my_global_var_callback($m) { return $GLOBALS[$m[1]]; }@@%0a%0ainstead of using %25hlt php%25@@PCCF()@@ to create anonymous functions, we add a real function in our add-on, and then pass the function name as the pattern replacement (see example at [[#PCCF|PCCF]], which will also work on PHP 4 and 5):%0a=> %25hlt php%25@@'/(?%3c=^| )([a-z])/' => '%25green%25my_callback%25%25',@@%0a>>%3c%3c%0a%0a(:if false:)(:comment Needs review and may change:)%0a!![[#PRCB]] PRCB()%0a%25hlt php%25[@PRCB($pat, $repl, $subj, $vars=null, $limit=-1, &$count=null, $flags=0)@]%0a%0aThe %25hlt php%25@@PRCB()@@ function (''PmWiki Regex Replace Callback'') makes it simple to pass variables to a named callback function with [[https://php.net/preg_replace_callback|preg_replace_callback()]].%0a%0aIf you need to use preg_replace_callback() and pass some variables to the callback function, you can do something like:%0a%0a%25hlt php%25[@$result = PRCB($patern, 'my_callback', $subject, $pagename);@]%0a%0aThen your function will be called this way: %25hlt php%25[@my_callback($matches, $pagename);@]. You can pass multiple variables with an array.%0a%0aThe function can also be used without passing variables, just shorter than @@preg_replace_callback()@@:%0a%0a%25hlt php%25[@$result = PRCB($patern, 'my_callback', $subject);@]%0a%0a(:ifend:)%0a%0a!![[#Qualify]] Qualify()%0a%25hlt php%25[@Qualify($pagename, $text)@]%0a%0a%25hlt php%25@@Qualify()@@ applies $QualifyPatterns to convert relative links and references into absolute equivalents.%0aThis function is called by usual wiki markups that include text from other pages.%0aIt will rewrite links like %25pmhlt%25[@[[Page]]@] into [@[[Group/Page]]@], and page (text) variables like [@{$Title}@] into [@{Group.Page$Title}@]%0aso that they work the same way in the source page and in the including page.%0aSee also $QualifyPatterns and %25pmhlt%25@@[[({$Name}#)RetrieveAuthSection]]()@@.%0a%0a%0a!![[#PHSC]] PHSC()%0a%25hlt php%25[@PHSC($string_or_array, $flags=ENT_COMPAT, $encoding=null, $double_encode=true)@]%0a%0aThe %25hlt php%25@@PHSC()@@ function (''PmWiki HTML Special Characters'') is a replacement for the PHP function [[https://www.php.net/htmlspecialchars|htmlspecialchars]]. %0a%0aThe %25hlt php%25@@htmlspecialchars()@@ function was modified since PHP 5.4 in two ways: it now requires a valid string for the supplied encoding, and it changes the default encoding to UTF-8. This can cause sections of the page to become blank/empty on many sites using the ISO-8859-1 encoding without having set the third argument ($encoding) when calling @@htmlspecialchars()@@.%0a%0aThe %25hlt php%25@@PHSC()@@ function calls @@htmlspecialchars()@@ with an 8-bit encoding as third argument, whatever the encoding of the wiki (unless you supply an encoding). This way the string never contains invalid characters.%0a%0aIt should be safe for recipe developers to replace all calls to %25hlt php%25@@htmlspecialchars()@@ with calls to @@PHSC()@@. Only the first argument is required when calling @@PHSC()@@, although authors may wish to call @@PHSC($string_or_array, ENT_QUOTES)@@.%0a%0aUnlike %25hlt php%25@@htmlspecialchars()@@, the @@PHSC()@@ function can process arrays recursively (only the values are converted, not the keys of the array).%0a%0a!![[#PSS]] PSS()%0a%25hlt php%25[@PSS($string)@]%0a%0aThe %25hlt php%25@@PSS()@@ function (''PmWiki Strip Slashes'') removes the backslashes that are automatically inserted in front of quotation marks by the /e option of PHP's preg_replace function. @@PSS()@@ is%0amost commonly used in replacement arguments to @@Markup()@@, when the pattern specifies /e and one or more of the parenthesized subpatterns could contain a quote or backslash. %0a("PSS" stands for "PmWiki Strip Slashes".)%0a->From PM: PmWiki expects %25hlt php%25@@PSS()@@ to always occur inside of double-quoted strings and to contain single quoted strings internally. The reason for this is that we don't want the @@$1@@ or @@$2@@ to accidentally contain characters that would then be interpreted inside of the double-quoted string when the PSS is evaluated.%0a-->%25hlt php%25@@Markup('foo', 'inline', '/(something)/e', 'Foo(PSS("$1"))'); # wrong@@%0a-->%25hlt php%25@@Markup('foo', 'inline', '/(something)/e', "Foo(PSS('$1'))"); # right@@%0a%0a%25note%25 Note, the extra slashes are only added by %25hlt php%25@@preg_replace()@@ with an @@/e@@ modifier. The markup definitions with @@Markup_e()@@ do NOT need to use @@PSS()@@ in the replacement strings. The new-type markup definitions with @@Markup()@@ and a simple function name as a replacement do NOT need to use @@PSS()@@ inside the replacement function. If you migrate old markup rules to the new format, delete the @@PSS()@@ calls.%0a%0a!!! Example %25block notoc%25%0aThis is a fictitious example where %25hlt php%25@@PSS()@@ should be used.%0aLet us assume that you wish to define a directive %25pmhlt%25[@(:example:)@]%0asuch that %25pmhlt%25[@(:example "A horse":)@] results in the HTML%0a-> %25hlt html%25[@%3cdiv>"A horse"%3c/div>@].%0aHere is how the markup rule can be created:%0a-> %25hlt php%25[@%0aMarkup('example', 'directives',%0a '/\\(:example\\s(.*?):\\)/e',%0a "Keep('%3cdiv>'.PSS('$1').'%3c/div>')");%0a@]%0aWe need to use %25hlt php%25@@PSS()@@ around the '@@$1@@' because the matched text could contain quotation marks, and the @@/e@@ will add backslashes in front of them.%0a%0a!![[#stripmagic]] stripmagic()%0a%25hlt php%25[@stripmagic($string)@]%0a%0aThis function should be used when processing the contents of %25hlt php%25[@$_POST@] or [@$_GET@] variables when they could contain quotes or backslashes. It verifies [@get_magic_quotes()@], if true, strips the automatically inserted escapes from the string.%0a%0aThe function can process arrays recursively (only the values are processed).%0a%0a!![[#FmtPageName]] FmtPageName()%0a%0a%25hlt php%25[@FmtPageName($fmt, $pagename)@]%0a%0a[[#FmtPageName-desc]]Returns %25hlt php%25[@$fmt@], with @@$variable@@ and [=$[internationalisation]=] substitutions performed, under the assumption that the current page is [@pagename@]. See [[PmWiki.Variables]] for an (incomplete) list of available variables, [[PmWiki.Internationalizations]] for internationalisation. Security: not to be run on user-supplied data.%0a%0aThis is one of the major functions in PmWiki, see [[PmWiki.FmtPageName]] for%0alots of details.%0a%0a%0a!![[#Markup]] Markup()%0a%25hlt php%25[@Markup($name, $when, $pattern, $replace)@]%0a%0a[[#Markup-desc]]Adds a new markup to the conversion table. Described in greater detail at [[PmWiki.CustomMarkup]].%0a%0aThis function is used to insert translation rules into the PmWiki's translation engine. The arguments to %25hlt php%25[@Markup()@] are all strings, where:%0a%0a:%25hlt php%25[@$name@]: The string names the rule that is inserted. If a rule of the same name already exists, then this rule is ignored.%0a:%25hlt php%25[@$when@]: This string is used to control ''when'' a rule is to be applied relative to other rules. A specification of "[@%3cxyz@]" says to apply this rule prior to the rule named "xyz", while "[@>xyz@]" says to apply this rule after the rule "xyz". See [[(PmWiki:)CustomMarkup]] for more details on the order of rules.%0a:%25hlt php%25[@$pattern@]: This string is a [[regular expression -> https://www.php.net/preg_replace]] that is used by the translation engine to look for occurrences of this rule in the markup source. ''The pattern needs to use "/" as delimiters.''%0a:%25hlt php%25[@$replace@]: This string will replace the matched text when a match occurs, or the function name that will return the replacement text.%0a%0aAlso see: [[PmWiki.CustomMarkup]] and [[Cookbook:Functions#Markup]]%0a%0a!![[#MarkupToHTML]] MarkupToHTML()%0a%0a%25hlt php%25[@MarkupToHTML($pagename, $str)@]%0a%0a[[#MarkupToHTML-desc]] Converts the string %25hlt php%25[@$str@] containing PmWiki markup into the corresponding HTML code, assuming the current page is [@$pagename@].%0a%25hlt php%25@@MarkupToHTML()@@ replaces @@\n\n@@ sequences by @@%3c:vspace>@@ first thing when text is passed to it. Subsequently @@%3c:vspace>@@ is processed by the markup rules:%0a-> '@@!vspace@@' removes @@%3c:vspace>@@ after headings.%0a-> '@@%3cvspace>%3cp>@@' replaces @@%3c:vspace>%3cp>@@ with @@%3cp class='vspace'>@@%0a-> '@@%3cvspace>@@' replaces %3c:vspace> with @@%3cdiv class='vspace'>@@%0a-> and finally%0a-> '@@^%3c:@@' removes any remaining @@%3c:vspace>@@, mostly from restored [=[=]=escaped text=].%0a%0aAlso see: [[Cookbook:Functions#MarkupToHTML]]%0a%0a!![[#mkdirp]] mkdirp()%0a%25hlt php%25[@mkdirp($dir)@]%0a%0aThe function %25hlt php%25[@mkdirp($dir)@] creates a directory, [@$dir@], if it doesn't already exist, including any parent directories that might be needed. For each directory created, it checks that the permissions on the directory are sufficient to allow PmWiki scripts to read and write files in that directory. This includes checking for restrictions imposed by PHP's safe_mode setting. If [@mkdirp()@] is unable to successfully create a read/write directory, [@mkdirp()@] aborts with an error message telling the administrator the steps to take to either create @@$dir@@ manually or give PmWiki sufficient permissions to be able to do it.%0a%0a!![[#Lock]] Lock()%0a%25hlt php%25[@Lock(0)@]%0a%0aThis function is used to make sure only one instance of PmWiki is running when files are being written. It does not "lock pages" for editing.%0a%0aFrom a recipe, use:%0a* %25hlt php%25[@Lock(2);@] to acquire an ''exclusive'' lock, so that no other PHP processes can modify files. This can be used when your function is writing files on the server.%0a* %25hlt php%25[@Lock(1);@] to acquire a ''shared'' lock. This may be used when your function is reading files from the server, in case another process is writing them at the same time.%0a* %25hlt php%25[@Lock(0);@] to ''release'' a previous exclusive or shared lock. Use this immediately after your function finishes reading or writing the files.%0a%0aIf you don't release an acquired lock, it should be automatically released at the end of the processing.%0a%0a%0a!![[#MakeLink]] MakeLink()%0a%25hlt php%25[@MakeLink($pagename, $target, $txt, $suffix, $fmt)@]%0a%0aThe function %25hlt php%25[@MakeLink($pagename, $target, $txt, $suffix, $fmt)@] returns an html-formatted anchor link. Its arguments are as follows:%0a $pagename is the source page%0a $target is where the link should go%0a $txt is the value to use for '$LinkText' in the output %0a $suffix is any suffix string to be added to $txt%0a $fmt is a format string to use%0a%0aIf $txt is NULL or not specified, then it is automatically computed from $target.%0a%0aIf $fmt is NULL or not specified, then MakeLink uses the default%0aformat as specified by the type of link. For page links this%0ameans the $LinkPageExistsFmt and $LinkPageCreateFmt variables,%0afor intermap-style links it comes from either the $IMapLinkFmt%0aarray or from $UrlLinkFmt. Inside of the formatting strings,%0a$LinkUrl is replaced by the resolved url for the link, $LinkText%0ais replaced with the appropriate text, and $LinkAlt is replaced%0aby any "title" (alternate text) information associated with the%0alink.%0a%0aAlso see: [[PmWiki:MakeLink]] and [[Cookbook:Functions#MakeLink]]%0a%0a!![[#MakeUploadName]] MakeUploadName()%0a%25hlt php%25@@MakeUploadName($pagename, $x)@@%0a%0a%25hlt php%25@@MakeUploadName()@@ simply takes a string @@$x@@ (representing an attachment's%0aname) and converts it to a valid name by removing any unwanted characters.%0aIt also requires the name to begin and end with an alphanumeric character,%0aand as of 2.0.beta28 it forces any file extensions to lowercase.%0aThis function is defined in @@scripts/upload.php@@ and only used when uploads%0aare enabled.%0a%0a!![[#DownloadUrl]] DownloadUrl()%0a%25hlt php%25@@DownloadUrl($pagename, $path)@@%0a%0aThis function returns the public URL of an attached file. The arguments are as follow:%0a* $pagename - the currently processed page%0a* %25hlt php%25@@$path@@ - the file path, as in @@file.ext@@ or @@OtherPage/file.ext@@ or @@Group/OtherPage/file.ext@@%0a%0aIf the file doesn't exist, the function returns false. The global variable %25hlt php%25@@$FmtV['$LinkUpload']@@ contains the URL to the upload form, for a file with such a name to be attached. The global variable %25hlt php%25@@$FmtV['$LinkDownload']@@ contains the URL to the file, as if it were uploaded to the wiki.%0a%0aThe function calls [[#MakeUploadName|%25hlt php%25@@MakeUploadName()@@]] on the @@$path@@ argument so you don't need to do it before calling it.%0a%0aThe returned URL respects $UploadPrefixFmt and $EnableDirectDownload of the wiki.%0a%0a%0a!![[#SessionAuth]] SessionAuth()%0a%25hlt php%25[@SessionAuth($pagename, $auth=NULL)@]%0a%0a%25hlt php%25@@SessionAuth()@@ manages keeping authentication via cookie-sessions. Session contains every password or validated id and associated groups from previous calls. It adds elements passed by @@$auth@@ to session. It also writes every element saved in session to @@$AuthPw(passwords)@@ and @@$AuthList(ids and groups)@@.%0a%0a!![[#IsAuthorized]] IsAuthorized()%0a%25hlt php%25[@IsAuthorized($chal, $source, &$from)@]%0a%0a%25hlt php%25@@IsAuthorized()@@ takes a pageattributesstring (e. g. "id:user1 $1$Ff3w34HASH...") in @@$chal@@.%0a%0a%25hlt php%25@@$source@@ is simply returned and used for building the authcascade (pageattributes - groupattributes - @@$DefaultPassword@@).%0a%0a%25hlt php%25@@$from@@ will be returned if @@$chal@@ is empty, because it is not checked before calling @@IsAuthorized()@@, this is needed for the authcascade. %0a%25hlt php%25@@IsAuthorized()@@ returns an array with three values: @@$auth@@ @@1@@ - authenticated, @@0@@ - not authenticated, @@-1@@ - refused; @@$passwd@@; @@$source@@ from the parameter list.%0a%0a!![[#CondAuth]] CondAuth()%0a%25hlt php%25[@CondAuth($pagename, 'auth level')@]%0a%0a%25hlt php%25[@CondAuth()@]%25%25 implements the [[ConditionalMarkup]] for %25pmhlt%25[@(:if auth level:)@]%25%25. For instance %25hlt php%25[@ CondAuth($pagename,'edit')@]%25%25 is true if authorization level is 'edit'. Use inside local configuration files to build conditionals with a check of authorization level, similar to using %25pmhlt%25[@(:if auth level:)@]%25%25 on a wiki page.%0a%0aNote that %25hlt php%25@@CondAuth()@@ should be called after all authorization levels and passwords have been defined. For example, if you use it with [[Drafts]], you should include the @@draft.php@@ script before calling @@CondAuth()@@:%0a%25hlt php%25[@%0a $EnableDrafts = 1;%0a $DefaultPasswords['publish'] = pmcrypt('secret');%0a include_once("$FarmD/scripts/draft.php");%0a if (! CondAuth($pagename, 'edit')) { /* whatever */ }%0a@]%0aBest is to use %25hlt php%25@@CondAuth()@@ near the bottom of your @@config.php@@ script.%0a%0a!! [[#RetrieveAuthPage]] RetrieveAuthPage()%0a%25hlt php%25@@RetrieveAuthPage($pagename, $level, $authprompt=true, $since=0)@@%0a%0aPm words as said in https://www.pmwiki.org/pipermail/pmwiki-users/2005-April/012804.html %0awhere:%0a%0a $pagename - name of page to be read%0a $level - authorization level required (read/edit/auth/upload)%0a $authprompt - true if user should be prompted for a password if needed%0a $since - how much of the page history to read%0a 0 == read entire page including all of history%0a READPAGE_CURRENT == read page without loading history%0a timestamp == read history only back through timestamp%0a%0aThe @@$since@@ parameter allows PmWiki to stop reading from a page file%0aas soon as it has whatever information is needed -- i.e., if an operation%0asuch as browsing isn't going to need the page's history, then specifying%0aREADPAGE_CURRENT can result in a much faster loading time. (This can be %0aespecially important for things such as searching and page listings.)%0aHowever, if combined with %25hlt php%25@@UpdatePage()@@, the updated page will have no history.%0a%0aUse e.g. %25hlt php%25[@$page = @RetrieveAuthPage('Main.MyPage', 'read')@] to obtain a page object that contains all the information of the correspondent file in separate keys, e.g. [@$page['text']@] will contain a string with the current wiki markup of Main.MyPage. Use this generally in preference to the alternative function [@ReadPage($pagename, $since=0)@] since it respects the authorisation of the user, i.e. it checks the authorisation level before loading the page, or it can be set to do so. [@ReadPage()@] reads a page regardless of permission.%0a%0aPassing 'ALWAYS' as the authorization level (instead of 'read', 'edit', etc.) will cause %25hlt php%25@@RetrieveAuthPage()@@ to always read and return the page, even if it happens to be protected by a read password.%0a%0a%0a!! [[#RetrieveAuthSection]] RetrieveAuthSection()%0a%25hlt php%25@@RetrieveAuthSection($pagename, $pagesection, $list=NULL, $auth='read')@@%0a%0a%25hlt php%25@@RetrieveAuthSection()@@ extracts a section of text from a page. If @@$pagesection@@ starts with anything other than '@@#@@', the text before the first '@@#@@' (or all of it, if there is no '@@#@@') identifies the page to extract text from. Otherwise @@RetrieveAuthSection()@@ looks in the pages given by @@$list@@ (should be an array), or in @@$pagename@@ if @@$list@@ is not specified. %0a* The selected page is placed in the global @@$RASPageName@@ variable. %0a* The caller is responsible for calling %25hlt php%25@@Qualify()@@ as needed, i.e. if you need to control how unqualified page and variable names shall be resolved.%0a** To have them act as in the original text, let %25hlt php%25@@Qualify()@@ resolve them relative to the source page.%0a** If the imported text was not meant as wikitext but as some other kind of markup that might happen to contain double pairs of square brackets, (:comment %3c-- not: pairs of 〚double square brackets〛 = U+301A/U+301B:) or dollar signs inside curly brackets, you probably don't want to %25hlt php%25@@Qualify()@@ them. If you output them into wikitext, you'll probably need to @@Keep()@@ the text (:comment %3c-- translators: conceptually this means to have Keep() pack the text in a container that marks it as "final".:) (in case of HTML, XML, RSS or similar output, @@PHSC()@@ first!), to prevent later stages of processing from interpreting the apparent wiki markups in context of the target page.%0a** If your code produces wikitext for an auxiliary page that is meant to be included by another page higher up in the inclusion chain, and want links and variables to work as if they were in the auxiliary page, use the auxiliary page's "GroupName.PageName" as the $pagename argument for %25hlt php%25@@Qualify()@@.%0a%0aProvides a way to limit the array that is returned by ReadPage, so that it only pulls the content up to a specific section marker. For example, pulling from start of page to '##blogend':%0a->%25hlt php%25[@%0afunction FeedText($pagename, &$page, $tag) {%0a $text = RetrieveAuthSection($pagename, '##blogend');%0a $content = MarkupToHTML($pagename, $text);%0a return "%3c$tag>%3c![CDATA[$content]]>%3c/$tag>";%0a}%0a@]%0a%0aThe '##blogend' argument says to read from the beginning of the page to just before the line containing the [[#blogend]] marker. See%0a[[PmWiki:IncludeOtherPages | IncludeOtherPages]] for more information about the section specifications.%0a%0aThis version won't read text from pages that are read-protected; if you want to get text even from read-protected pages, then %0a->%25hlt php%25[@%0a $text = RetrieveAuthSection($pagename, '##blogend', NULL, 'ALWAYS');%0a@]%0a%0a%0a!! [[#UpdatePage]] UpdatePage()%0a%25hlt php%25@@UpdatePage($pagename, $old (page object), $new (page object));@@%0a%0a''[[PmWiki:UpdatePage|More Technical Notes]]''%0a%0a%25hlt php%25[@UpdatePage()@] allows cookbook recipes to mimic the behavior of editing wiki pages via the browser. Internally, PmWiki does several housekeeping tasks which are accessible via this function (preserving history/diff information, updating page revision numbers, updating RecentChanges pages, sending email notifications, etc._%0a* "Page object" refers to an array pulled from %25hlt php%25[@RetrieveAuthPage($pagename, $level, $authprompt=true, $since=0);@] (preferred), or [@ReadPage($pagename); @] (disregards page security). Note that @@$new['text']@@ should contain all page data for the new version of the page. %0a* If a page doesn't exist, %25hlt php%25@@UpdatePage()@@ will attempt to create it.%0a* Ignoring @@$old@@ (e.g. %25hlt php%25[@UpdatePage($pagename, '', $new);@]) will erase all historical page data---a ''tabula rasa''.%0a** If you retrieved @@$old@@ using %25hlt php%25@@RetrieveAuthPage($pagename,$auth,$prompt,READPAGE_CURRENT)@@ and set @@$new=$old@@, then @@UpdatePage()@@ will also erase all historical data%0a%25hlt php%25@@UpdatePage()@@ cannot be called directly from @@config.php@@ because there are necessary initializations which occur later in @@pmwiki.php@@. It is not enough to just load @@stdconfig.php@@. If you want to use @@UpdatePage()@@ you will need to do it within a [[PmWiki:CustomMarkup | custom markup]], a [[Cookbook:MarkupExpressionSamples | custom markup expression]], or a [[PmWiki:CustomActions | custom action]].%0a%0a%0a!! [[#InsertEditFunction]] InsertEditFunction()%0a%25hlt php%25@@InsertEditFunction($newfn, $where='%3cPostPage')@@%0a%0aThis function makes it easy for recipe authors to insert a custom function in a specific position of the processing, see $EditFunctions and [[#UpdatePage|UpdatePage()]]. %0a%0aThe first argument is the name of the new function.%0a%0aThe second argument is the position where to place the new function, related to other edit functions? It can be:%0a* @@"%3c"@@ at the start, before the first edit function%0a* @@">"@@ at the end, after the last edit function%0a* @@"%3cExistingEditFunction"@@ before a specified edit function%0a* @@">ExistingEditFunction"@@ after a specified edit function%0a%0aThe function will return ''true'' on success, and ''false'' on failure (when the specified position or existing function was not recognized).%0a%0a!! [[#DisableSkinParts]] DisableSkinParts()%0a%25hlt php%25@@DisableSkinParts('parts to disable');@@%0a%0aThis function allows easy disabling of the skin sections header, footer, title, actions, and sidebars, like the corresponding directives %25pmhlt%25@@[=(:notitle:) (:noleft:)=]@@ etc. In your function, use something like:%0a->%25hlt php%25[@%0a DisableSkinParts('Left Header Footer Action Title');%0a@]%0a%0a!! [[#ParseArgs]] ParseArgs()%0aSee Cookbook:ParseArgs. %0a%0a!! [[#Redirect]] Redirect()%0a%0a!! [[#PageIndexTerms]] PageIndexTerms()%0a%0a!! [[#AsSpaced]] AsSpacedUTF8(), AsSpaced()%0a>>hlt php%3c%3c%0a@@AsSpaced()@@ is declared in @@pmwiki.php@@ \\%0a@@AsSpaced()@@ converts a string with WikiWords into a spaced version of that string.%0aIt can be overridden via $AsSpacedFunction, as it is in @@AsSpacedUTF8()@@. \\%0a@@AsSpacedUTF8()@@ is declared in the @@xlpage-utf-8.php@@ script.%0a>>%3c%3c%0a%0aCategories: [[!PmWiki Developer]] +time=1724101330 diff --git a/wikilib.d/PmWiki.InterMap b/wikilib.d/PmWiki.InterMap index 934c1288..2f5c0542 100644 --- a/wikilib.d/PmWiki.InterMap +++ b/wikilib.d/PmWiki.InterMap @@ -1,9 +1,9 @@ -version=pmwiki-2.3.16 ordered=1 urlencoded=1 -author=Petko +version=pmwiki-2.3.36 ordered=1 urlencoded=1 +author=simon charset=UTF-8 -csum=generic example.org example, pmhlt (+23) +csum=update intermap.txt contents to 2.3.36 value (+81) name=PmWiki.InterMap -rev=65 +rev=67 targets=PmWiki.WikiWikiWeb,Site.InterMap,PmWiki.Variables,Cookbook.RelativeUrls,Cookbook.RelativeLinks,PmWiki.LinkSchemes,PmWiki.WikiFarms,PmWiki.Upgrades,PmWiki.LinkVariables,PmWiki.BasicVariables,PmWiki.PathVariables -text=(:Summary: Interwiki links definition and use:)%0a(:Audience: author (intermediate) :)%0a%0aThe InterMap (also called InterWiki in some other wikis) is a system for defining links between [[WikiWikiWeb]] sites that was first developed by UseMod and Meatball (see UseMod:InterWiki and Meatball:InterWiki). The method is to use a word shortcut that stands for a defined path. InterMap links have the form [@MapPrefix:PagePath@], where the host prefix is converted to a partial URL based on entries in the site's ''intermap.txt'' and ''localmap.txt'' files.%0a%0a[[#custominclude]]%0a!! The default intermap.txt%0a%0aThe default ''intermap.txt'' distributed with PmWiki (in the ''scripts/'' directory) includes the following InterMap entries:%0a>>pre%3c%3c%0a PmWiki: https://www.pmwiki.org/wiki/PmWiki/ %0a Cookbook: https://www.pmwiki.org/wiki/Cookbook/ %0a Wiki: http://www.c2.com/cgi/wiki? %0a UseMod: http://www.usemod.com/cgi-bin/wiki.pl? %0a Meatball: http://www.usemod.com/cgi-bin/mb.pl? %0a Wikipedia: https://en.wikipedia.org/wiki/ %0a PITS: https://www.pmwiki.org/wiki/PITS/ %0a PmL10n: https://www.pmwiki.org/wiki/Localization/%0a Path:%0a>>%3c%3c%0a%0a!! The page [[{$SiteGroup}.InterMap]]%0a(:if exists {$SiteGroup}.InterMap:)%0a[[{$SiteGroup}.InterMap]] includes the following entries:%0a(:include {$SiteGroup}.InterMap#include#includeend:)%0a(:else:)%0aYou can map your own prefixes in your local page [[{$SiteGroup}.InterMap]].%0a(:ifend:)%0a[[#customincludeend]]%0a%0aThus, "PmWiki:Variables" becomes "https://www.pmwiki.org/wiki/PmWiki/" + "Variables", a link to the [[PmWiki.Variables->https://www.pmwiki.org/wiki/PmWiki/Variables]] page on the official PmWiki web site, Wiki:FrontPage is a link to the front page of the first WikiWikiWeb, and Wikipedia:Stonehenge takes you to the Wikipedia article about the famous megaliths in England. %0a%0a!! Usage in a wiki page%0a%0aLike other links, you can use the double-bracket syntax to get different link text:%0a(:markup class=horiz:)%0a* [[Meatball:StartingPoints | starting points]] over at Meatball%0a* [[starting points -> Meatball:StartingPoints]] over at Meatball%0a(:markupend:)%0a%0aIf you want to link just to what the intermap says (e.g. https://en.wikipedia.com/wiki/ for Wikipedia), then do %25pmhlt%25[@[[Wikipedia:. | Wikipedia's main page]]@], which produces [[Wikipedia:. | Wikipedia's main page]]. Note the . (period) after the Map: reference.%0a%0a[[#path]]%0aThe special [@Path:@] InterMap entry can be used to create "[[Cookbook:RelativeUrls|relative urls]]" in [[Cookbook:RelativeLinks|links]].%0a%0a!! Custom InterMap prefixes%0aThe actual set of InterMap links at any site is defined by the site administrator via the [[Site.InterMap]] page and the ''local/localmap.txt'' file.%0a%0aAn intermap entry takes the following format:%0a%0a-> [@%0aMapPrefix: https://example.com/partial/url/%0a@]%0a%0aThe InterMap entry can be for any of the [[(PmWiki:)link schemes]] supported by PmWiki.%0a[[%3c%3c]]%0aYou can create your own InterMap links by doing one or more of the following:%0a%0a* Modify the page called ''[[{$SiteGroup}.InterMap]]'' and place entries like the ones above in it.%0a* Create a file called ''local/localmap.txt'' and place entries like the ones above in it.%0a* In a [[WikiFarm(s)]] installation you can create a file called%0a ''local/farmmap.txt'' and there place entries like the ones above in it.%0a These prefixes will be common to all the wikis in the farm.%0a* Ensure that there is a space after the colon.%0a%0aDo not edit the file ''scripts/intermap.txt'' directly! If you do, you'll%0alose your changes when you [[PmWiki/upgrade(s)]] PmWiki.%0a%0a%0a!! Variables and InterMap links%0a%0aIt's possible to use variables within your InterMap entries. The following%0aentries create [@ThisWiki:@] and [@ThisPage:@] shortcuts:%0a%0a-> [@%0aThisWiki: $ScriptUrl%0aThisPage: {$PageUrl}%0a@]%0a%0aYou can also define InterMap entries where the text of the entry is%0asubstituted into the middle of the URL. Just include '$1' in the URL where%0ayou want the substitution to take place. For example:%0a%0a->[@Jargon: http://catb.org/~esr/jargon/html/$1.html@]%0a%0awould cause [@Jargon:F/feature-creep@] to be converted to [@http://catb.org/~esr/jargon/html/F/feature-creep.html@].%0a%0a%0a!! Tips and tricks%0a%0aIt is possible to document your intermap prefixes directly in the page%0a[[Site.InterMap]]. The extra text will not cause a performance penalty, nor%0awill it break the definition of prefixes. However, be aware that anything%0amatching a line starting with a word and a colon (''':''') will be%0aconsidered to define a prefix.%0a%0aThe order in which various sources are checked for definitions of prefixes%0ais controlled by the variable $InterMapFiles. Currently the precedence%0a(highest to lowest is as follows):%0a* ''local/localmap.txt''%0a* ''$SiteGroup.InterMap''%0a* ''$FarmD/local/farmmap.txt''%0a* ''$FarmD/scripts/intermap.txt''%0a%0a%0a>>faq%3c%3c [[#faq]]%0a%0aQ: Are InterMap names case sensitive?%0aA: Yes, thus [@eAdmin:@] is a different InterMap link than [@EAdmin:@].%0a%0aQ: How can I achieve a ''localmap.txt'' mapping with the effect of [@Pics: Path:/somepathto/pics/@]?%0aA: Use the following:%0a->[@Pics: /somepathto/pics/@]%0a%0a%0aQ: How can I define an InterMap in PHP?%0aA: Use the following:%0a->%25hlt php%25[@%0a $LinkFunctions['PmWikiHome:'] = 'LinkIMap';%0a $IMap['PmWikiHome:'] = 'https://pmwiki.org/wiki/$1';%0a@]%0a%0aQ: How can I define an InterMap link that lets me refer to files at the server "root"?%0aA: From the page %25pmhlt%25@@[=https://example.org/index.php/Main/HomePage=]@@ I want to create a relative link to a directory at the "root" level of the site. The fully qualified URL is @@[=https://example.org/commoninfo/infoaboutu.php=]@@. I want to do this because the domain name will change, which would break an absolute link.%0a%0a->Create an InterMap link like so:%0a Root /%0a->Then your relative link can be:%0a Root:commoninfo/infoaboutu.php%0a%0aA: Or, you can use the predefined "Path:" prefix, as in %25pmhlt%25[@Path:/commoninfo/infoaboutu.php@].%0a -time=1670584765 +text=(:Summary: Interwiki links definition and use:)%0a(:Audience: author (intermediate) :)%0a%0aThe InterMap (also called InterWiki in some other wikis) is a system for defining links between [[WikiWikiWeb]] sites that was first developed by UseMod and Meatball (see UseMod:InterWiki and Meatball:InterWiki). The method is to use a word shortcut that stands for a defined path. InterMap links have the form [@MapPrefix:PagePath@], where the host prefix is converted to a partial URL based on entries in the site's ''@@intermap.txt@@'' and ''@@localmap.txt@@'' files.%0a%0a[[#custominclude]]%0a!! The default intermap.txt%0a%0aThe default ''@@intermap.txt@@'' distributed with PmWiki (in the ''@@scripts/@@'' directory) includes the following InterMap entries:%0a>>pre%3c%3c%0a PmWiki: https://www.pmwiki.org/wiki/PmWiki/ %0a Cookbook: https://www.pmwiki.org/wiki/Cookbook/ %0a Skins: https://www.pmwiki.org/wiki/Skins/%0a Wiki: http://www.c2.com/cgi/wiki? %0a UseMod: http://www.usemod.com/cgi-bin/wiki.pl? %0a Meatball: http://www.usemod.com/cgi-bin/mb.pl? %0a Wikipedia: https://en.wikipedia.org/wiki/ %0a PITS: https://www.pmwiki.org/wiki/PITS/ %0a PmL10n: https://www.pmwiki.org/wiki/Localization/%0a Path:%0a>>%3c%3c%0a%0a%0a!! The page [[{$SiteGroup}.InterMap]]%0a(:if exists {$SiteGroup}.InterMap:)%0a[[{$SiteGroup}.InterMap]] includes the following entries:%0a(:include {$SiteGroup}.InterMap#include#includeend:)%0a(:else:)%0aYou can map your own prefixes in your local page [[{$SiteGroup}.InterMap]].%0a(:ifend:)%0a[[#customincludeend]]%0a%0aThus, "PmWiki:Variables" becomes "https://www.pmwiki.org/wiki/PmWiki/" + "Variables", a link to the [[PmWiki.Variables->https://www.pmwiki.org/wiki/PmWiki/Variables]] page on the official PmWiki web site, Wiki:FrontPage is a link to the front page of the first WikiWikiWeb, and Wikipedia:Stonehenge takes you to the Wikipedia article about the famous megaliths in England. %0a%0a!! Usage in a wiki page%0a%0aLike other links, you can use the double-bracket syntax to get different link text:%0a(:markup class=horiz:)%0a* [[Meatball:StartingPoints | starting points]] over at Meatball%0a* [[starting points -> Meatball:StartingPoints]] over at Meatball%0a(:markupend:)%0a%0aIf you want to link just to what the intermap says (e.g. https://en.wikipedia.com/wiki/ for Wikipedia), then do %25pmhlt%25[@[[Wikipedia:. | Wikipedia's main page]]@], which produces [[Wikipedia:. | Wikipedia's main page]]. Note the . (period) after the Map: reference.%0a%0a[[#path]]%0aThe special [@Path:@] InterMap entry can be used to create "[[Cookbook:RelativeUrls|relative urls]]" in [[Cookbook:RelativeLinks|links]].%0a%0a!! Custom InterMap prefixes%0aThe actual set of InterMap links at any site is defined by the site administrator via the [[Site.InterMap]] page and the ''local/localmap.txt'' file.%0a%0aAn intermap entry takes the following format:%0a%0a-> [@%0aMapPrefix: https://example.com/partial/url/%0a@]%0a%0aThe InterMap entry can be for any of the [[(PmWiki:)link schemes]] supported by PmWiki.%0a[[%3c%3c]]%0aYou can create your own InterMap links by doing one or more of the following:%0a%0a* Modify the page called ''[[{$SiteGroup}.InterMap]]'' and place entries like the ones above in it.%0a* Create a file called ''@@local/localmap.txt@@'' and place entries like the ones above in it.%0a* In a [[WikiFarm(s)]] installation you can create a file called%0a ''@@local/farmmap.txt@@'' and there place entries like the ones above in it.%0a These prefixes will be common to all the wikis in the farm.%0a* Ensure that there is a space after the colon.%0a%0aDo not edit the file ''@@scripts/intermap.txt@@'' directly! If you do, you'll%0alose your changes when you [[PmWiki/upgrade(s)]] PmWiki.%0a%0a%0a!! Variables and InterMap links%0a%0aIt's possible to use variables within your InterMap entries. The following%0aentries create [@ThisWiki:@] and [@ThisPage:@] shortcuts:%0a%0a-> [@%0aThisWiki: $ScriptUrl%0aThisPage: {$PageUrl}%0a@]%0a%0aYou can also define InterMap entries where the text of the entry is%0asubstituted into the middle of the URL. Just include '$1' in the URL where%0ayou want the substitution to take place. For example:%0a%0a->[@Jargon: http://catb.org/~esr/jargon/html/$1.html@]%0a%0awould cause [@Jargon:F/feature-creep@] to be converted to [@http://catb.org/~esr/jargon/html/F/feature-creep.html@].%0a%0a%0a!! Tips and tricks%0a%0aIt is possible to document your intermap prefixes directly in the page%0a[[Site.InterMap]]. The extra text will not cause a performance penalty, nor%0awill it break the definition of prefixes. However, be aware that anything%0amatching a line starting with a word and a colon (''':''') will be%0aconsidered to define a prefix.%0a%0aThe order in which various sources are checked for definitions of prefixes%0ais controlled by the variable $InterMapFiles. Currently the precedence%0a(highest to lowest is as follows):%0a* ''local/localmap.txt''%0a* ''$SiteGroup.InterMap''%0a* ''$FarmD/local/farmmap.txt''%0a* ''$FarmD/scripts/intermap.txt''%0a%0a%0a>>faq%3c%3c [[#faq]]%0a%0aQ: Are InterMap names case sensitive?%0aA: Yes, thus [@eAdmin:@] is a different InterMap link than [@EAdmin:@].%0a%0aQ: How can I achieve a ''@@localmap.txt@@'' mapping with the effect of [@Pics: Path:/somepathto/pics/@]?%0aA: Use the following:%0a->[@Pics: /somepathto/pics/@]%0a%0a%0aQ: How can I define an InterMap in PHP?%0aA: Use the following:%0a->%25hlt php%25[@%0a $LinkFunctions['PmWikiHome:'] = 'LinkIMap';%0a $IMap['PmWikiHome:'] = 'https://pmwiki.org/wiki/$1';%0a@]%0a%0aQ: How can I define an InterMap link that lets me refer to files at the server "root"?%0aA: From the page %25pmhlt%25@@[=https://example.org/index.php/Main/HomePage=]@@ I want to create a relative link to a directory at the "root" level of the site. The fully qualified URL is @@[=https://example.org/commoninfo/infoaboutu.php=]@@. I want to do this because the domain name will change, which would break an absolute link.%0a%0a->Create an InterMap link like so:%0a Root /%0a->Then your relative link can be:%0a Root:commoninfo/infoaboutu.php%0a%0aA: Or, you can use the predefined "Path:" prefix, as in %25pmhlt%25[@Path:/commoninfo/infoaboutu.php@].%0a +time=1723463959 diff --git a/wikilib.d/PmWiki.LayoutVariables b/wikilib.d/PmWiki.LayoutVariables index 4866e3b4..9b79072c 100644 --- a/wikilib.d/PmWiki.LayoutVariables +++ b/wikilib.d/PmWiki.LayoutVariables @@ -1,9 +1,9 @@ -version=pmwiki-2.3.34 ordered=1 urlencoded=1 +version=pmwiki-2.3.36 ordered=1 urlencoded=1 author=Petko charset=UTF-8 -csum=typo (+3) +csum=$EnablePreserveLineBreaks (+109) name=PmWiki.LayoutVariables -rev=186 +rev=189 targets=PmWiki.LayoutVariables,PmWiki.BasicVariables,PmWiki.AvailableActions,PmWiki.PageVariables,PmWiki.PageDirectives,PmWiki.PageHistory,Cookbook.DarkColorScheme,PmWiki.UploadVariables,Cookbook.LocalTimes,Cookbook.PmSyntax,Cookbook.CustomSyntax,PmWiki.WikiStyles,PmWiki.SkinTemplates,PmWiki.WikiGroup,PmWiki.Questions,Cookbook.CustomRecentChanges,Cookbook.RecentUploadsLog,PmWiki.CustomWikiStyles,Cookbook.LocalCSS,PmWiki.TableOfContents,Cookbook.ToggleNext,PmWiki.PathVariables,PmWiki.Tables,PITS.00638,Cookbook.RowspanInSimpleTables,PmWiki.TableDirectives,PmWiki.Skins,Skins.SkinChange,PmWiki.WikiTrails,PmWiki.OtherVariables,PmWiki.EditVariables -text=(:Summary:variables that control page layout:)%0aVariable substitutions in the skin template are all managed by the %25hlt php%25@@`FmtPageName()@@ %25%25function from @@pmwiki.php@@. Pmwiki variable substitutions available on pages are managed by the {$var} substitutions from @@stdmarkup.php@@ or superseded in @@local/config@@ files. %0a%0a:$ActionSkin:This array is used to override the current skin when performing a given action. The most common use is to set %25hlt php%25@@$ActionSkin['print']='foo'@@ to use the 'foo' skin when printing, regardless of what the @@$Skin@@ variable is set to.%0a%0a:$ActionTitleFmt: An array that adds a separator and the current [[PmWiki:AvailableActions|wiki action]] ('edit', 'attr', 'diff', 'upload'...) to the HTML title of the page (the $ActionTitle variable in $HTMLTitleFmt or the skin template). By default it is localized [@"| action"@], but you can change it:%0a: : %25hlt php%25[@$ActionTitleFmt['edit'] = ': $[Edit]';@] # use a ":" colon separator%0a: : %25hlt php%25[@$ActionTitleFmt['edit'] = ' $[Edit] ';@] # space separator, may be placed at the start of $HTMLTitleFmt%0a%0a:$WikiTitle:A variable which contains the Wiki title as displayed in the browser tab and at the top of the browser window, e.g. "{$WikiTitle}"%0a%0a:$HTMLTitleFmt:A variable that overrides the content of the %25hlt html%25[@%3ctitle>...%3c/title>@]%25%25 element in the skin template. Here you can set this format without editing the skin template. For example:%0a: : %25hlt php%25@@$HTMLTitleFmt = '$Title | $WikiTitle $ActionTitle';@@ # Page title first, then $WikiTitle, then the action e.g. "| Edit", and the wiki group $Group is omitted.%0a: : %25hlt php%25@@$HTMLTitleFmt = '$Title | $GroupHomePageTitle';@@ # Page title first, then the title of the group landing page, see [[PageVariables]].%0a%0a:$EnablePageTitlePriority:A variable defining how to treat multiple %25pmhlt%25[@(:title ...:)@] [[page directives]] (added in PmWiki 2.2.9).%0a: : %25hlt php%25@@$EnablePageTitlePriority = 0;@@ # PmWiki default, last encountered title wins (the title may be changed from included pages or GroupFooter).%0a: : %25hlt php%25@@$EnablePageTitlePriority = 1;@@ # First title wins; if a title is defined in the page, directives from included pages cannot change it.%0a%0a:$EnableDiffInline:If set to 0, this variable switches off the word-level highlighting on the markup in the [[page history]].%0a: : %25hlt php%25@@$EnableDiffInline = 0;@@ # Disable colors, show plain text differences%0a%0a:$EnableRCDiffBytes:If set to 1, @@(All)RecentChanges@@ pages will display the difference in bytes of the page content from the previous version like %25diffmarkup%25{+(+123)+} or {-(-42)-}%25%25%0a: : %25hlt php%25@@$EnableRCDiffBytes = 1;@@ # Show bytes difference from previous version%0a%0a: : The colors are the same as those in the page history; if your skin doesn't provide them, add to ''@@pub/css/local.css@@'' something like: %25hlt css%25[@%0a.diffmarkup { font-family: monospace; font-size: 0.9em; } %0a.diffmarkup del { background: #ff9; text-decoration: none; }%0a.diffmarkup ins { background: #9f9; text-decoration: none; }@]%0a%0a:$CurrentTime: This variable contains the current date and time formatted with $TimeFmt. It is used in @@RecentChanges@@ (before 2.3.0), and in user signatures.%0a%0a:$CurrentLocalTime: This variable contains the current date and time stamp, saved in @@RecentChanges@@ (since 2.3.0). This time stamp will be saved in the wiki source text in Greenwich Mean Time (UTC/GMT), but will be shown according to $TimeFmt in the timezone of the wiki. When $EnableLocalTimes is enabled, then it will be shown in the visitor's time zone. The same format is also saved in user signatures if $EnableLocalTimes is enabled.%0a%0a:$EnablePmUtils: This variable controls whether the script @@pub/pmwiki-utils.js@@ should be loaded or not. The script contains JavaScript utility functions for the table of contents, the syntax highlighting, the recent changes, and the email obfuscation, and the dark color theme. By default $EnablePmUtils is 1 (enabled), but most functions need to be enabled individually ($EnableLocalTimes, $EnableHighlight, $PmTOC, $LinkFunctions['mailto:'], $EnableCopyCode, $EnableSortable, $ToggleNextSelector, $EnablePmSyntax, $CustomSyntax, $EnableCopyCode, $EnableDarkThemeToggle). Set this variable to 0 to disable all these functions.%0a%0a:$EnableDarkThemeToggle: This variable enables the core functions for toggling a dark color scheme, if the skin supports this feature, see Cookbook:DarkColorScheme. Can be set in a skin.php file (as global variable) or in config.php:%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 0; @@ dark theme toggling is disabled, even if the skin supports it%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 1; @@ dark theme toggling is enabled, with light theme by default%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 2; @@ dark theme toggling is enabled, with dark theme by default%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 3; @@ use automatically the theme preferred by the browser%0a: : See also $ImgDarkSuffix.%0a%0a:$EnableLocalTimes: (Default disabled) Enables the rewriting of date and time stamps into the timezone of the visitor, see documentation at Cookbook:LocalTimes. Dates affected are in RecentChanges pages, in page histories, and in user signatures.%0a: : %25hlt php%25@@ $EnableLocalTimes = 2; @@ Enables '''long''' local times, as in MM/DD/YYYY HH:MM:SS.%0a: : %25hlt php%25@@ $EnableLocalTimes = 1; @@ Enables '''compact''' local times, either HH:MM (within 24 hours), MM/DD or DD/MM (within 11 months), and MM/DD/YYYY or DD/MM/YYYY if earlier than 11 months. The long format appears in a tooltip title when the mouse is over the short format.%0a: : %25hlt php%25@@ $EnableLocalTimes = 3; @@ Like the '''compact''' local times, but when the date is earlier than 11 months, shows MM'YY.%0a%0a:$EnablePmSyntax: (Not to be confused with $EnableHighlight) When set to 1, enables [[Cookbook:PmSyntax|PmSyntax]], a syntax highlighting for the PmWiki markup language, which makes the documentation easy to read (from 2.3.0). When set to 2, it also enables the experimental syntax highlighting in the basic edit form: %25hlt php%25[@%0a$EnablePmSyntax = 1; # highlight documentation blocks%0a$EnablePmSyntax = 2; # both documentation and edit form%0aif ($action=='edit') $EnablePmSyntax = 2; # only edit form@]%0a%0a:$CustomSyntax:(From 2.3.0) An array where custom rules for syntax highlighting can be defined. See documentation at Cookbook:CustomSyntax.%0a%0a:$EnableHighlight: (Not to be confused with $EnablePmSyntax) If set to 1, enables compatibility with the [[https://github.com/highlightjs/highlight.js|highlight.js]] library to highlight program code. In addition, you need to include the library and mark your code blocks with the wikistyle [@%25highlight%25@], see [[WikiStyles#highlight]].%0a%0a:$EnableCopyCode: (From 2.3.21) When set to 1, adds a [@[+]@] button near the top right of preformatted blocks. A user clicking on the button will have the text of the preformatted block copied to their system clipboard: %25hlt php%25[@%0a$EnableCopyCode = 1; # add a [+] copy code button to pre blocks@]%0a%0a:$HTMLTagAttr:A string containing attributes of the %25hlt html%25@@%3chtml...>@@ tag in the skin template, default empty. For example, to add a "lang" attribute, set in @@config.php@@: %25hlt php%25[@%0a$HTMLTagAttr = 'lang="en" xml:lang="en"';@]%0a: : For this variable to work in a custom skin, add it in the template file, for example:%25hlt html%25[@%0a%3chtml xmlns="http://www.w3.org/1999/xhtml" $HTMLTagAttr>@]%0a%0a:$HTMLStylesFmt:An array of CSS statements to be included in the page's output along with other HTML headers. This array provides an easy place for scripts to add custom CSS statements.%0a%0a:$HTMLHeaderFmt:An array of HTML text to be included in the page's %25hlt html%25@@%3chead>@@ section, at the point where the [[skin template(s)]] specifies a [@%3c!--HTMLHeader-->@] directive. This array provides an easy place for scripts to add custom HTML headers.%0a%0a->For example, if you want to specify a [[Wikipedia:Favicon|favicon]] for all the pages of your wiki (a png image for Firefox (and others...), an ico for Internet Explorer):%0a-->%25hlt php%25[@%0a$HTMLHeaderFmt['favicon'] =%0a'%3clink href="http://path/to/icon.png" type="image/png" rel="icon" />%0a %3clink href="http://path/to/icon.ico" type="image/x-icon" rel="shortcut icon" />';%0a@]%0a%0a->Another example, if you want to get the RSS notification on some browsers (the RSS icon in Firefox for instance):%0a-->%25hlt php%25[@%0a$HTMLHeaderFmt['rss'] =%0a'%3clink rel="alternate" type="application/rss+xml" title="Rss All recent Changes" %0a href="$ScriptUrl/Site/AllRecentChanges?action=rss" />';%0a@]%0a%0a->Javascript example%0a-->%25hlt php%25[@%0a$HTMLHeaderFmt['the-javascript'] =%0a'%3cscript>%0a // the javascript code%0a %3c/script>';@]%0a%0a:$HTMLFooterFmt:Like $HTMLHeaderFmt above, this contains an array of HTML text to be included near the end of an HTML document, at the point where the [[skin template(s)]] specifies a %25hlt php%25[@%3c!--HTMLFooter-->@] directive (usually just before a closing @@%3c/body>@@ tag). Primarily used by scripts to add custom HTML output after the body of the page output. %0a%0a:$MetaRobots:Sets the value of the %25hlt php%25[@%3cmeta name='robots' ... />@] tag generated by PmWiki to control search engine robots accessing the site. PmWiki's default setting tells robots to not index anything but the normal page view, and to not index pages in the PmWiki [[wiki group]]. Explicitly setting $MetaRobots overrides this default.%0a--> %25hlt php%25[@# never index this site%0a$MetaRobots = 'noindex,nofollow';%0a# disable the robots tag entirely%0a$MetaRobots = ''; @]%0a%0a:$MessagesFmt:An array of HTML text to be displayed at the point of any %25pmhlt%25[@(:messages:)@] markup. Commonly used for displaying messages with respect to editing pages.%0a%0a:$RecentChangesFmt:An array specifying the format of the RecentChanges listing.%0a%0a->The key of the array specifies the page where changes will be logged, as in%0a-->%25hlt php%25[@%0a$RecentChangesFmt['$SiteGroup.AllRecentChanges']%0a@]%0a->The value of the array specifies the format in which the changes will be logged, as in%0a-->%25pmhlt%25[@%0a'* [[{$Group}.{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'%0a@]%0a->Note the two consecutive spaces before the three dots (@@. . .@@). The two spaces separate two parts of the format: the first part doesn't change (e.g. a link to the changed page) and the second part does change (e.g. the date and author of the change). Upon saving a page, PmWiki removes a line that matches the first part and adds a line with the current format before the first line with 2 spaces. This way, any line without two consecutive spaces stays at the top of the recent changes page.%0a%0a->You can use and adapt the following to change the format (put it in config.php):%0a-->%25hlt php%25[@%0a$RecentChangesFmt['$SiteGroup.AllRecentChanges'] = %0a '* [[{$Group}.{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a$RecentChangesFmt['$Group.RecentChanges'] =%0a '* [[{$Group}/{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a@]%0a-> Since PmWiki 2.3.0, the format uses $CurrentLocalTime by default which shows exactly what $CurrentTime previously showed, but when $EnableLocalTimes is set, will rewrite the time and date in the local format and timezone of the visitor. %0a%0a->Note that changes made to the format will only affect new edits. In other words, you will need to edit a page for your new format to be visible. Note also that you need to have two spaces between the page name and the other information about the edit.%0a%0a->Also note that this variable has other uses, such as not reporting at all to RecentChanges and AllRecentChanges as found here [[PmWiki:Questions|PmWiki Questions]]. More informations on customizing RecentChanges pages here : [[Cookbook/CustomRecentChanges]].%0a%0a:$RecentUploadsFmt:An array specifying the format for uploaded files at the RecentChanges listing. It is similar to $RecentChangesFmt. If enabled, newly uploaded files will be logged to the RecentChanges pages. Default is disabled. See Cookbook:RecentUploadsLog for more information. See also $EnableRecentUploads.%0a%0a:$EnableRecentUploads: When set to 1, and when $RecentUploadsFmt is not set, it enables Recent uploads in a default format, only on the page Site.AllRecentChanges. This was added in 2.3.0 to easily enable the feature with some default settings that may be good enough for many wikis.%0a%0a:$DraftRecentChangesFmt:An array specifying the format of the RecentChanges listing when saving Draft pages.%0a%0a->$RecentChangesFmt is set to $DraftRecentChangesFmt when a Draft page is saved. For example, you could save drafts in a separate Recent Draft Changes page and not list in the normal group's Recent Changes page:%0a-->%25hlt php%25[@%0a$DraftRecentChangesFmt['$Group.RecentDraftChanges'] =%0a '* [[{$Group}/{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a$DraftRecentChangesFmt['$Group.RecentChanges'] = '';%0a@]%0a%0a:$RCLinesMax:The maximum number of lines to be stored in RecentChanges pages. The default is zero, meaning "no limit".%0a $RCLinesMax = 1000; # maintain at most 1000 recent changes%0a%0a:$PageRedirectFmt:The text to be used when a page is redirected via the [@(:redirect:)@] markup.%0a-->%25hlt php%25[@%0a$PageRedirectFmt = '%3cp>%3ci>redirected from $FullName%3c/p>';%0a$PageRedirectFmt = '';%0a@]%0a->For display options, see also the FAQ on [[(PmWiki:)PageDirectives(#faq)]].%0a%0a:$WikiStyle:An array which contains the predefined WikiStyles which can be used on a textpage.[[%3c%3c]]See: [[PmWiki.CustomWikiStyles]]%0a%0a:$WikiStyleApply:An array which defines the scope of wiki styling per HTML element. Default settings are:%0a->%25hlt php%25[@%0a'item' => 'li|dt',%0a'list' => 'ul|ol|dl',%0a'div' => 'div',%0a'pre' => 'pre',%0a'img' => 'img',%0a'block' => 'p(?!\\sclass=)|div|ul|ol|dl|li|dt|pre|h[1-6]',%0a'p' => 'p(?!\\sclass=)'%0a@]%0a%0a->This defines that we can apply wiki styling on:%0a* LI elements using the ''item'' keyword%0a* UL, OL, DL elements using the ''list'' keyword%0a* etc.%0a%0a->An example of applying scope to an LI element is below. For more information refer to [[PmWiki/WikiStyles#Scope | WikiStyle scope]].%0a(:markup class=horiz:) %0a* %25apply=item red%25Here is a red styled list item%0a* This item would not be styled.%0a(:markupend:)%0a%0a->You can [[PmWiki.WikiStyles#WikiStyleApply | add additional HTML elements to $WikiStyleApply]] to apply wiki styles to other HTML elements. For example to allow styling on table rows, or anchor tags.%0a%0a:$WikiPageCSSFmt: This variable holds a page name where you can add CSS rules applied to specific page patterns (default disabled). See Cookbook:LocalCSS as an example.%0a: : %25hlt php%25@@$WikiPageCSSFmt = 'Site.LocalCSS'; # global Site.LocalCSS page@@%0a: : %25hlt php%25@@$WikiPageCSSFmt = '[={$Group}=].LocalCSS'; # per-group LocalCSS pages@@%0a%0a:$WikiPageCSSVars: If a "wiki CSS page" is enabled with $WikiPageCSSFmt, this is an array with global PHP $variables available as pre-processor @variables in that page. By default the array contains: @@'FarmPubDirUrl', 'PubDirUrl', 'Skin', 'action', 'SkinDirUrl'@@.%0a%0a:$EnableSelfWikiPageCSS: If a "wiki CSS page" is enabled with $WikiPageCSSFmt, that specific page doesn't have CSS applied to itself when browsed or edited. In case a grave mistake is made in the styles and the site becomes unusable, this page will still be viewable and editable. People familiar with CSS can set this to 1 and the styles will be applied to the page itself, also in "Preview" mode:%0a: : %25hlt php%25@@$EnableSelfWikiPageCSS = 1; # Apply styles to the "wiki CSS page" itself@@%0a%0a:$PmTOC: Enable and configure the built-in table of contents, see [[Table of contents]] (TOC).%0a: : %25hlt php%25@@$PmTOC['Enable'] = 1; # Enable TOC; default is 0 (disabled).@@%0a%0a:$ToggleNextSelector: A CSS selector to enable interactive toggling of hidden sections, see Cookbook:ToggleNext. By default it is disabled.%0a%0a:$MaxIncludes:Controls the number of times that pages can be included via the %25pmhlt%25[@(:include:)@] and other directives, used to control recursion and otherwise pose a sanity check on page contents. $MaxIncludes defaults to 50, but can be set to any value by the wiki administrator.%0a--> %25hlt php%25[@$MaxIncludes = 50; # default%0a$MaxIncludes = 1000; # allow lots of includes%0a$MaxIncludes = 0; # turn off includes @]%0a%0a:$Skin:Lists the name(s) of skins to load, unless overridden by $ActionSkin. Normally $Skin contains a single string which is the name of a skin directory, but it may also be an array of names, in which case the first skin found from the list is used.%0a%0a:$SkinDirUrl:Set by ''@@scripts/skins.php@@'' to be the base url of the current skin's directory (i.e., within a '@@pub/skins/@@' directory). This variable is typically used inside of a skin @@.tmpl@@ file to provide access to @@.css@@ files and graphic images associated with the skin.%0a%0a:$SkinLibDirs:An array which, given the filesystem path (array key) to a skin (or a directory containing several skins), provides the corresponding URL (array value).%0a%0a->The array key is the directory containing the @@skin.tmpl@@ and @@skin.php@@ files, as seen by the PmWiki program. It does not have to be publicly accessible.%0a%0a-> The value is the URL (web address) of the directory containing the @@.css@@, @@.gif@@, and other files which appear in the HTML code sent by PMWiki to the browser. This directory must be publicly accessible.%0a%0a->By default $SkinLibDirs is set to:%0a--> %25hlt php%25[@%0a$SkinLibDirs = array(%0a "./pub/skins/\$Skin" => "$PubDirUrl/skins/\$Skin",%0a "$FarmD/pub/skins/\$Skin" => "$FarmPubDirUrl/skins/\$Skin");%0a@]%0a%0a->Extra details: When PMWiki is searching for a skin it looks for a directory named for the skin in the array index/keys, and if it finds it then it will use the files in that directory and also the files in the matching array value url. The two sides normally point to the same publicly accessible directory, but they do not have to.%0a%0a:$SkinTemplateIncludeLevel: how many levels of inclusion are allowed for [[skin templates]] with the %25hlt html%25[@%3c!--IncludeTemplate:...-->@]%25%25 directive. By default this directive is disabled. Setting it to 1 allows one level of inclusions, setting it to 2 allows included templates to include more templates. There can be up to 10 levels of inclusion. This variable can be defined either in @@local/config.php@@ or in @@pub/skins/skinname/skinname.php@@ (with SDV):%25hlt php%25[@%0a # in config.php, allow one level of inclusions%0a $SkinTemplateIncludeLevel = 1; %0a%0a # in skinname.php, allow 3 levels of inclusions%0a SDV($GLOBALS['SkinTemplateIncludeLevel'], 3); %0a@]%0a%0a:$PageLogoUrl: is the url that refers to a logo image which most skins display somewhere in the page's header (top left usually), e.g. "{$PageLogoUrl}"%0a%0a:$EnablePathInfo:Changes the handling of the page URL. When set to @@1@@ page URL will be @@...wiki.php/Main/Main@@, when set to @@0@@ (default) it will be @@...wiki.php?n=Main.Main@@.%0a%0a:$EnableFixedUrlRedirect:When PmWiki is given a partial page name (e.g., just the name of a WikiGroup), it uses $PagePathFmt in order to make a complete page name from the partial one, then issues a "redirect" to the browser to tell it to reload the page with the correct full page name. Setting %25hlt php%25@@$EnableFixedUrlRedirect=0;@@ blocks the redirect, so that PmWiki continues processing with the adjusted page name rather than issuing the redirect. %0a%0a:$GroupHeaderFmt:Defines the markup placed at the top of every page. Default value is:%0a [=$GroupHeaderFmt = '(:include {$Group}.GroupHeader self=0 basepage={*$FullName}:)(:nl:)';=]%0a%0a:$GroupPrintHeaderFmt:Defines the markup placed at the top of every page when [@action=print@]. Default value is:%0a [=SDV($GroupPrintHeaderFmt,'(:include $Group.GroupPrintHeader basepage={*$FullName}:)(:nl:)');=]%0a%0a:$GroupFooterFmt:Defines the markup placed at the bottom of every page. Default value is:%0a [=$GroupFooterFmt = '(:nl:)(:include {$Group}.GroupFooter self=0 basepage={*$FullName}:)';=]%0a%0a:$GroupPrintFooterFmt:Defines the markup placed at the bottom of every page when [@action=print@]. Default value is:%0a [=SDV($GroupPrintFooterFmt,'(:nl:)(:include $Group.GroupPrintFooter basepage={*$FullName}:)');=]%0a%0a:$PageNotFoundHeaderFmt:Specifies the HTTP header to send when attempting to browse a page that doesn't exist. Some webserver packages (notably Microsoft's "Personal Web Server") require that this variable be changed in order to work.%0a%0a-->%25hlt php%25[@%0a# default%0a$PageNotFoundHeaderFmt = 'HTTP/1.1 404 Not Found';%0a# return all pages as found%0a$PageNotFoundHeaderFmt = 'HTTP/1.1 200 Ok';%0a@]%0a%0a->Beware when expecting to return the content of a Group(header|footer) for an non existent page! By default PmWiki returns 404 (because the page does not exist), despite there is some content to show. Firefox shows the content, while Internet Explorer displays its default 404 page. $PageNotFoundHeaderFmt MUST be set to return 200 as described above in order to get the expected behaviour with all browsers.%0a%0a:$HTMLVSpace:Setting %25hlt php%25[@$HTMLVSpace = '';@]%25%25 in a local customizationfile (e.g., [@local/config.php@]) prevents insertion of spacer paragraphs (%25hlt html%25[@%3cp class='vspace'>%3c/p>@]%25%25) in generated HTML code. To limit this change to a single skin, place the %25hlt php%25[@$HTMLVSpace = '';@] statement in a @@skin.php@@ file, preceded by the statement %25hlt php%25[@global $HTMLVSpace;@].%0a%0a:$HTMLPNewline:This variable allows to enable linebreaks by default, i.e. without having the directive %25pmhlt%25[@(:linebreaks:)@] in a page or in a GroupHeader. To enable line breaks, add to @@config.php@@ such a line:\\%0a %25hlt php%25@@$HTMLPNewline = '%3cbr/>'; @@%0a%0a:$SimpleTableDefaultClassName:This variable can contain a CSS classname to be used for [[tables|simple tables]], if a "class=" attribute is not defined in the wiki page (default unset):\\%0a%25hlt php%25@@ $SimpleTableDefaultClassName = "wikisimpletable";@@\\%0aSee for sample code PITS:00638.%0a%0a:$EnableSimpleTableRowspan:If set to 1, will enable features replicating the recipe Cookbook:RowspanInSimpleTables (default disabled).\\%0a@@ $EnableSimpleTableRowspan = 1; @@ # See [[Cookbook:RowspanInSimpleTables|recipe]]%0a%0a:$EnableSortable:Set this variable to 1 to enable sortable tables, see [[Tables#sortable]] (default disabled):%25hlt php%25[@%0a$EnableSortable = 1; # Enable sortable tables@]%0a%0a:$TableCellAttrFmt:For [[Tables]], defines the HTML attributes given to each @@%3ctd>@@ or @@%3cth>@@ cell in the output. Can contain references to $TableCellCount which holds the horizontal column number of the current cell.%0a%0a:$TableCellAlignFmt:For [[Tables]], defines the HTML attributes for alignment of each @@%3ctd>@@ or @@%3cth>@@ cell. Default is @@" align='%25s'"@@ where %25s will be replaced with 'center', 'left' or 'right'. For a valid HTML5 output you may want to change this in @@config.php@@:\\%0a%25hlt php%25@@$TableCellAlignFmt = " class='%25s'";@@\\%0athen define the CSS classes td.center, td.right and td.left (also th).%0a%0a:$TableRowAttrFmt:For [[Tables]], defines the HTML attributes given to each @@%3ctr>@@ element in the output. Can contain references to $TableRowCount to give the absolute row number within the table, or $TableRowIndex to provide a repeating row index from 1 to $TableRowIndexMax.%0a-> %25hlt php%25[@# Give each row a unique CSS class based on row number (tr1, tr2, tr3, ... )%0a$TableRowAttrFmt = "class='tr\$TableRowCount'";%0a# Give each row alternating CSS classes (ti1, ti2, ti1, ti2, ti1, ... )%0a$TableRowIndexMax = 2;%0a$TableRowAttrFmt = "class='ti\$TableRowIndex'"; @]%0a%0a:$TableRowIndexMax:The maximum value for $TableRowIndex in [[Tables]].%0a-> %25hlt php%25[@# Set rows indexes as 1, 2, 3, 1, 2, 3, 1, 2, ...%0a$TableRowIndexMax = 3; @]%0a%0a:$EnableTableAutoValignTop:[[TableDirectives|Advanced tables]] are intended for layout, and automatically insert the @@valign='top'@@ attribute if there is no @@valign@@ attribute defined in the markup source. Setting this variable to 0 in config.php will prevent the automatic addition.%0a-> %25hlt php%25@@$EnableTableAutoValignTop = 0; # disable automatic valign='top' attr@@%0a%0a:$EnableAutoSkinList:This variable enables the change of the [[PmWiki/skins|skin]] from the URL to any skin available on the wiki installation. See also $PageSkinList and Skins:SkinChange.%0a%0a:$PageSkinList:This is an array of allowed skins that can be changed by the visitor with @@?skin=@@ or @@?setskin=@@ URL query to the wiki. See also $EnableAutoSkinList and Skins:SkinChange.%0a%0a:$TrailFmt: An array of HTML snippets containing the layout of the [[WikiTrails]] output. If you define one or more custom values in config.php, they will be used. Here are the default values:\\%0a%25hlt php%25[@%0a$TrailFmt['%3c%3c|'] = "%3cspan class='wikitrail'><< \$prev | \$trailname | \$next >>%3c/span>";%0a$TrailFmt['%3c|'] = "%3cspan class='wikitrail'>\$prev\$trailname\$next%3c/span>";%0a$TrailFmt['^|'] = "%3cspan class='wikitrail'>\$crumbs%3c/span>";%0a@]%0a%0a:$TrailPathSep: the trail separator of the "path" trail ( %25pmhlt%25[@^|[[TrailIndexPage]]|^@] ). For instance @@$TrailPathSep = ' > ';@@ will output "[=TrailIndexPage > TrailPage2 > TrailPage4=]".%0a%0a:$InputLabelFmt: A HTML snippet containing the layout of the "label" after an input form field. If you define a custom value in config.php, it will be used. The default value has initial and trailing spaces: \\%0a%25hlt php%25[@$InputLabelFmt = ' %3clabel for="$LabelFor" $LabelTitle>$LabelText%3c/label> '; @]%0a%0a:$FmtV['$TableCellCount']:PMWiki internal variable - Horizontal column number of the current cell. For use in $TableCellAttrFmt and $TableRowAttrFmt. Administrators can use in $TableCellAttrFmt and/or $TableRowAttrFmt.%0a-> Example: %25hlt php%25@@$TableCellAttrFmt = 'class=col\$TableCellCount';@@ %0a%0a:$FmtV['$TableRowCount']:PMWiki internal variable - Current row number. Administrators can use in $TableCellAttrFmt and/or $TableRowAttrFmt.%0a-> Example: %25hlt php%25@@TableRowAttrFmt = "class='row\$TableRowCount'";@@%0a%0a:$FmtV['$TableRowIndex']:PMWiki internal variable - Row index number derived from $TableRowIndexMax. (1,2,3,1,2,3,...). Administrators can use in $TableCellAttrFmt and/or $TableRowAttrFmt.%0a-> Example: %25hlt php%25@@$TableRowAttrFmt = "class='ind\$TableRowIndex'";@@%0a%0aSee also: [[Edit Variables]]%0a -time=1720327143 +text=(:Summary:variables that control page layout:)%0aVariable substitutions in the skin template are all managed by the %25hlt php%25@@`FmtPageName()@@ %25%25function from @@pmwiki.php@@. Pmwiki variable substitutions available on pages are managed by the {$var} substitutions from @@stdmarkup.php@@ or superseded in @@local/config@@ files. %0a%0a:$ActionSkin:This array is used to override the current skin when performing a given action. The most common use is to set %25hlt php%25@@$ActionSkin['print']='foo'@@ to use the 'foo' skin when printing, regardless of what the @@$Skin@@ variable is set to.%0a%0a:$ActionTitleFmt: An array that adds a separator and the current [[PmWiki:AvailableActions|wiki action]] ('edit', 'attr', 'diff', 'upload'...) to the HTML title of the page (the $ActionTitle variable in $HTMLTitleFmt or the skin template). By default it is localized [@"| action"@], but you can change it:%0a: : %25hlt php%25[@$ActionTitleFmt['edit'] = ': $[Edit]';@] # use a ":" colon separator%0a: : %25hlt php%25[@$ActionTitleFmt['edit'] = ' $[Edit] ';@] # space separator, may be placed at the start of $HTMLTitleFmt%0a%0a:$WikiTitle:A variable which contains the Wiki title as displayed in the browser tab and at the top of the browser window, e.g. "{$WikiTitle}"%0a%0a:$HTMLTitleFmt:A variable that overrides the content of the %25hlt html%25[@%3ctitle>...%3c/title>@]%25%25 element in the skin template. Here you can set this format without editing the skin template. For example:%0a: : %25hlt php%25@@$HTMLTitleFmt = '$Title | $WikiTitle $ActionTitle';@@ # Page title first, then $WikiTitle, then the action e.g. "| Edit", and the wiki group $Group is omitted.%0a: : %25hlt php%25@@$HTMLTitleFmt = '$Title | $GroupHomePageTitle';@@ # Page title first, then the title of the group landing page, see [[PageVariables]].%0a%0a:$EnablePageTitlePriority:A variable defining how to treat multiple %25pmhlt%25[@(:title ...:)@] [[page directives]] (added in PmWiki 2.2.9).%0a: : %25hlt php%25@@$EnablePageTitlePriority = 0;@@ # PmWiki default, last encountered title wins (the title may be changed from included pages or GroupFooter).%0a: : %25hlt php%25@@$EnablePageTitlePriority = 1;@@ # First title wins; if a title is defined in the page, directives from included pages cannot change it.%0a%0a:$EnableDiffInline:If set to 0, this variable switches off the word-level highlighting on the markup in the [[page history]].%0a: : %25hlt php%25@@$EnableDiffInline = 0;@@ # Disable colors, show plain text differences%0a%0a:$EnableRCDiffBytes:If set to 1, @@(All)RecentChanges@@ pages will display the difference in bytes of the page content from the previous version like %25diffmarkup%25{+(+123)+} or {-(-42)-}%25%25%0a: : %25hlt php%25@@$EnableRCDiffBytes = 1;@@ # Show bytes difference from previous version%0a%0a: : The colors are the same as those in the page history; if your skin doesn't provide them, add to ''@@pub/css/local.css@@'' something like: %25hlt css%25[@%0a.diffmarkup { font-family: monospace; font-size: 0.9em; } %0a.diffmarkup del { background: #ff9; text-decoration: none; }%0a.diffmarkup ins { background: #9f9; text-decoration: none; }@]%0a%0a:$CurrentTime: This variable contains the current date and time formatted with $TimeFmt. It is used in @@RecentChanges@@ (before 2.3.0), and in user signatures.%0a%0a:$CurrentLocalTime: This variable contains the current date and time stamp, saved in @@RecentChanges@@ (since 2.3.0). This time stamp will be saved in the wiki source text in Greenwich Mean Time (UTC/GMT), but will be shown according to $TimeFmt in the timezone of the wiki. When $EnableLocalTimes is enabled, then it will be shown in the visitor's time zone. The same format is also saved in user signatures if $EnableLocalTimes is enabled.%0a%0a:$EnablePmUtils: This variable controls whether the script @@pub/pmwiki-utils.js@@ should be loaded or not. The script contains JavaScript utility functions for the table of contents, the syntax highlighting, the recent changes, and the email obfuscation, and the dark color theme. By default $EnablePmUtils is 1 (enabled), but most functions need to be enabled individually ($EnableLocalTimes, $EnableHighlight, $PmTOC, $LinkFunctions['mailto:'], $EnableCopyCode, $EnableSortable, $ToggleNextSelector, $EnablePmSyntax, $CustomSyntax, $EnableCopyCode, $EnableDarkThemeToggle). Set this variable to 0 to disable all these functions.%0a%0a:$EnableDarkThemeToggle: This variable enables the core functions for toggling a dark color scheme, if the skin supports this feature, see Cookbook:DarkColorScheme. Can be set in a skin.php file (as global variable) or in config.php:%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 0; @@ dark theme toggling is disabled, even if the skin supports it%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 1; @@ dark theme toggling is enabled, with light theme by default%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 2; @@ dark theme toggling is enabled, with dark theme by default%0a: : %25hlt php%25@@ $EnableDarkThemeToggle = 3; @@ use automatically the theme preferred by the browser%0a: : See also $ImgDarkSuffix.%0a%0a:$EnableLocalTimes: (Default disabled) Enables the rewriting of date and time stamps into the timezone of the visitor, see documentation at Cookbook:LocalTimes. Dates affected are in RecentChanges pages, in page histories, and in user signatures.%0a: : %25hlt php%25@@ $EnableLocalTimes = 2; @@ Enables '''long''' local times, as in MM/DD/YYYY HH:MM:SS.%0a: : %25hlt php%25@@ $EnableLocalTimes = 1; @@ Enables '''compact''' local times, either HH:MM (within 24 hours), MM/DD or DD/MM (within 11 months), and MM/DD/YYYY or DD/MM/YYYY if earlier than 11 months. The long format appears in a tooltip title when the mouse is over the short format.%0a: : %25hlt php%25@@ $EnableLocalTimes = 3; @@ Like the '''compact''' local times, but when the date is earlier than 11 months, shows MM'YY.%0a%0a:$EnablePmSyntax: (Not to be confused with $EnableHighlight) When set to 1, enables [[Cookbook:PmSyntax|PmSyntax]], a syntax highlighting for the PmWiki markup language, which makes the documentation easy to read (from 2.3.0). When set to 2, it also enables the experimental syntax highlighting in the basic edit form: %25hlt php%25[@%0a$EnablePmSyntax = 1; # highlight documentation blocks%0a$EnablePmSyntax = 2; # both documentation and edit form%0aif ($action=='edit') $EnablePmSyntax = 2; # only edit form@]%0a%0a:$CustomSyntax:(From 2.3.0) An array where custom rules for syntax highlighting can be defined. See documentation at Cookbook:CustomSyntax.%0a%0a:$EnableHighlight: (Not to be confused with $EnablePmSyntax) If set to 1, enables compatibility with the [[https://github.com/highlightjs/highlight.js|highlight.js]] library to highlight program code. In addition, you need to include the library and mark your code blocks with the wikistyle [@%25highlight%25@], see [[WikiStyles#highlight]].%0a%0a:$EnableCopyCode: (From 2.3.21) When set to 1, adds a [@[+]@] button near the top right of preformatted blocks. A user clicking on the button will have the text of the preformatted block copied to their system clipboard: %25hlt php%25[@%0a$EnableCopyCode = 1; # add a [+] copy code button to pre blocks@]%0a%0a:$HTMLTagAttr:A string containing attributes of the %25hlt html%25@@%3chtml...>@@ tag in the skin template, default empty. For example, to add a "lang" attribute, set in @@config.php@@: %25hlt php%25[@%0a$HTMLTagAttr = 'lang="en" xml:lang="en"';@]%0a: : For this variable to work in a custom skin, add it in the template file, for example:%25hlt html%25[@%0a%3chtml xmlns="http://www.w3.org/1999/xhtml" $HTMLTagAttr>@]%0a%0a:$HTMLStylesFmt:An array of CSS statements to be included in the page's output along with other HTML headers. This array provides an easy place for scripts to add custom CSS statements.%0a%0a:$HTMLHeaderFmt:An array of HTML text to be included in the page's %25hlt html%25@@%3chead>@@ section, at the point where the [[skin template(s)]] specifies a [@%3c!--HTMLHeader-->@] directive. This array provides an easy place for scripts to add custom HTML headers.%0a%0a->For example, if you want to specify a [[Wikipedia:Favicon|favicon]] for all the pages of your wiki (a png image for Firefox (and others...), an ico for Internet Explorer):%0a-->%25hlt php%25[@%0a$HTMLHeaderFmt['favicon'] =%0a'%3clink href="http://path/to/icon.png" type="image/png" rel="icon" />%0a %3clink href="http://path/to/icon.ico" type="image/x-icon" rel="shortcut icon" />';%0a@]%0a%0a->Another example, if you want to get the RSS notification on some browsers (the RSS icon in Firefox for instance):%0a-->%25hlt php%25[@%0a$HTMLHeaderFmt['rss'] =%0a'%3clink rel="alternate" type="application/rss+xml" title="Rss All recent Changes" %0a href="$ScriptUrl/Site/AllRecentChanges?action=rss" />';%0a@]%0a%0a->Javascript example%0a-->%25hlt php%25[@%0a$HTMLHeaderFmt['the-javascript'] =%0a'%3cscript>%0a // the javascript code%0a %3c/script>';@]%0a%0a:$HTMLFooterFmt:Like $HTMLHeaderFmt above, this contains an array of HTML text to be included near the end of an HTML document, at the point where the [[skin template(s)]] specifies a %25hlt php%25[@%3c!--HTMLFooter-->@] directive (usually just before a closing @@%3c/body>@@ tag). Primarily used by scripts to add custom HTML output after the body of the page output. %0a%0a:$MetaRobots:Sets the value of the %25hlt php%25[@%3cmeta name='robots' ... />@] tag generated by PmWiki to control search engine robots accessing the site. PmWiki's default setting tells robots to not index anything but the normal page view, and to not index pages in the PmWiki [[wiki group]]. Explicitly setting $MetaRobots overrides this default.%0a--> %25hlt php%25[@# never index this site%0a$MetaRobots = 'noindex,nofollow';%0a# disable the robots tag entirely%0a$MetaRobots = ''; @]%0a%0a:$MessagesFmt:An array of HTML text to be displayed at the point of any %25pmhlt%25[@(:messages:)@] markup. Commonly used for displaying messages with respect to editing pages.%0a%0a:$RecentChangesFmt:An array specifying the format of the RecentChanges listing.%0a%0a->The key of the array specifies the page where changes will be logged, as in%0a-->%25hlt php%25[@%0a$RecentChangesFmt['$SiteGroup.AllRecentChanges']%0a@]%0a->The value of the array specifies the format in which the changes will be logged, as in%0a-->%25pmhlt%25[@%0a'* [[{$Group}.{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'%0a@]%0a->Note the two consecutive spaces before the three dots (@@. . .@@). The two spaces separate two parts of the format: the first part doesn't change (e.g. a link to the changed page) and the second part does change (e.g. the date and author of the change). Upon saving a page, PmWiki removes a line that matches the first part and adds a line with the current format before the first line with 2 spaces. This way, any line without two consecutive spaces stays at the top of the recent changes page.%0a%0a->You can use and adapt the following to change the format (put it in config.php):%0a-->%25hlt php%25[@%0a$RecentChangesFmt['$SiteGroup.AllRecentChanges'] = %0a '* [[{$Group}.{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a$RecentChangesFmt['$Group.RecentChanges'] =%0a '* [[{$Group}/{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a@]%0a-> Since PmWiki 2.3.0, the format uses $CurrentLocalTime by default which shows exactly what $CurrentTime previously showed, but when $EnableLocalTimes is set, will rewrite the time and date in the local format and timezone of the visitor. %0a%0a->Note that changes made to the format will only affect new edits. In other words, you will need to edit a page for your new format to be visible. Note also that you need to have two spaces between the page name and the other information about the edit.%0a%0a->Also note that this variable has other uses, such as not reporting at all to RecentChanges and AllRecentChanges as found here [[PmWiki:Questions|PmWiki Questions]]. More informations on customizing RecentChanges pages here : [[Cookbook/CustomRecentChanges]].%0a%0a:$RecentUploadsFmt:An array specifying the format for uploaded files at the RecentChanges listing. It is similar to $RecentChangesFmt. If enabled, newly uploaded files will be logged to the RecentChanges pages. Default is disabled. See Cookbook:RecentUploadsLog for more information. See also $EnableRecentUploads.%0a%0a:$EnableRecentUploads: When set to 1, and when $RecentUploadsFmt is not set, it enables Recent uploads in a default format, only on the page Site.AllRecentChanges. This was added in 2.3.0 to easily enable the feature with some default settings that may be good enough for many wikis.%0a%0a:$DraftRecentChangesFmt:An array specifying the format of the RecentChanges listing when saving Draft pages.%0a%0a->$RecentChangesFmt is set to $DraftRecentChangesFmt when a Draft page is saved. For example, you could save drafts in a separate Recent Draft Changes page and not list in the normal group's Recent Changes page:%0a-->%25hlt php%25[@%0a$DraftRecentChangesFmt['$Group.RecentDraftChanges'] =%0a '* [[{$Group}/{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a$DraftRecentChangesFmt['$Group.RecentChanges'] = '';%0a@]%0a%0a:$RCLinesMax:The maximum number of lines to be stored in RecentChanges pages. The default is zero, meaning "no limit".%0a $RCLinesMax = 1000; # maintain at most 1000 recent changes%0a%0a:$PageRedirectFmt:The text to be used when a page is redirected via the [@(:redirect:)@] markup.%0a-->%25hlt php%25[@%0a$PageRedirectFmt = '%3cp>%3ci>redirected from $FullName%3c/p>';%0a$PageRedirectFmt = '';%0a@]%0a->For display options, see also the FAQ on [[(PmWiki:)PageDirectives(#faq)]].%0a%0a:$WikiStyle:An array which contains the predefined WikiStyles which can be used on a textpage.[[%3c%3c]]See: [[PmWiki.CustomWikiStyles]]%0a%0a:$WikiStyleApply:An array which defines the scope of wiki styling per HTML element. Default settings are:%0a->%25hlt php%25[@%0a'item' => 'li|dt',%0a'list' => 'ul|ol|dl',%0a'div' => 'div',%0a'pre' => 'pre',%0a'img' => 'img',%0a'block' => 'p(?!\\sclass=)|div|ul|ol|dl|li|dt|pre|h[1-6]',%0a'p' => 'p(?!\\sclass=)'%0a@]%0a%0a->This defines that we can apply wiki styling on:%0a* LI elements using the ''item'' keyword%0a* UL, OL, DL elements using the ''list'' keyword%0a* etc.%0a%0a->An example of applying scope to an LI element is below. For more information refer to [[PmWiki/WikiStyles#Scope | WikiStyle scope]].%0a(:markup class=horiz:) %0a* %25apply=item red%25Here is a red styled list item%0a* This item would not be styled.%0a(:markupend:)%0a%0a->You can [[PmWiki.WikiStyles#WikiStyleApply | add additional HTML elements to $WikiStyleApply]] to apply wiki styles to other HTML elements. For example to allow styling on table rows, or anchor tags.%0a%0a:$WikiPageCSSFmt: This variable holds a page name where you can add CSS rules applied to specific page patterns (default disabled). See Cookbook:LocalCSS as an example.%0a: : %25hlt php%25@@$WikiPageCSSFmt = 'Site.LocalCSS'; # global Site.LocalCSS page@@%0a: : %25hlt php%25@@$WikiPageCSSFmt = '[={$Group}=].LocalCSS'; # per-group LocalCSS pages@@%0a%0a:$WikiPageCSSVars: If a "wiki CSS page" is enabled with $WikiPageCSSFmt, this is an array with global PHP $variables available as pre-processor @variables in that page. By default the array contains: @@'FarmPubDirUrl', 'PubDirUrl', 'Skin', 'action', 'SkinDirUrl'@@.%0a%0a:$EnableSelfWikiPageCSS: If a "wiki CSS page" is enabled with $WikiPageCSSFmt, that specific page doesn't have CSS applied to itself when browsed or edited. In case a grave mistake is made in the styles and the site becomes unusable, this page will still be viewable and editable. People familiar with CSS can set this to 1 and the styles will be applied to the page itself, also in "Preview" mode:%0a: : %25hlt php%25@@$EnableSelfWikiPageCSS = 1; # Apply styles to the "wiki CSS page" itself@@%0a%0a:$PmTOC: Enable and configure the built-in table of contents, see [[Table of contents]] (TOC).%0a: : %25hlt php%25@@$PmTOC['Enable'] = 1; # Enable TOC; default is 0 (disabled).@@%0a%0a:$ToggleNextSelector: A CSS selector to enable interactive toggling of hidden sections, see Cookbook:ToggleNext. By default it is disabled.%0a%0a:$MaxIncludes:Controls the number of times that pages can be included via the %25pmhlt%25[@(:include:)@] and other directives, used to control recursion and otherwise pose a sanity check on page contents. $MaxIncludes defaults to 50, but can be set to any value by the wiki administrator.%0a--> %25hlt php%25[@$MaxIncludes = 50; # default%0a$MaxIncludes = 1000; # allow lots of includes%0a$MaxIncludes = 0; # turn off includes @]%0a%0a:$Skin:Lists the name(s) of skins to load, unless overridden by $ActionSkin. Normally $Skin contains a single string which is the name of a skin directory, but it may also be an array of names, in which case the first skin found from the list is used.%0a%0a:$SkinDirUrl:Set by ''@@scripts/skins.php@@'' to be the base url of the current skin's directory (i.e., within a '@@pub/skins/@@' directory). This variable is typically used inside of a skin @@.tmpl@@ file to provide access to @@.css@@ files and graphic images associated with the skin.%0a%0a:$SkinLibDirs:An array which, given the filesystem path (array key) to a skin (or a directory containing several skins), provides the corresponding URL (array value).%0a%0a->The array key is the directory containing the @@skin.tmpl@@ and @@skin.php@@ files, as seen by the PmWiki program. It does not have to be publicly accessible.%0a%0a-> The value is the URL (web address) of the directory containing the @@.css@@, @@.gif@@, and other files which appear in the HTML code sent by PMWiki to the browser. This directory must be publicly accessible.%0a%0a->By default $SkinLibDirs is set to:%0a--> %25hlt php%25[@%0a$SkinLibDirs = array(%0a "./pub/skins/\$Skin" => "$PubDirUrl/skins/\$Skin",%0a "$FarmD/pub/skins/\$Skin" => "$FarmPubDirUrl/skins/\$Skin");%0a@]%0a%0a->Extra details: When PMWiki is searching for a skin it looks for a directory named for the skin in the array index/keys, and if it finds it then it will use the files in that directory and also the files in the matching array value url. The two sides normally point to the same publicly accessible directory, but they do not have to.%0a%0a:$SkinTemplateIncludeLevel: how many levels of inclusion are allowed for [[skin templates]] with the %25hlt html%25[@%3c!--IncludeTemplate:...-->@]%25%25 directive. By default this directive is disabled. Setting it to 1 allows one level of inclusions, setting it to 2 allows included templates to include more templates. There can be up to 10 levels of inclusion. This variable can be defined either in @@local/config.php@@ or in @@pub/skins/skinname/skinname.php@@ (with SDV):%25hlt php%25[@%0a # in config.php, allow one level of inclusions%0a $SkinTemplateIncludeLevel = 1; %0a%0a # in skinname.php, allow 3 levels of inclusions%0a SDV($GLOBALS['SkinTemplateIncludeLevel'], 3); %0a@]%0a%0a:$PageLogoUrl: is the url that refers to a logo image which most skins display somewhere in the page's header (top left usually), e.g. "{$PageLogoUrl}"%0a%0a:$EnablePathInfo:Changes the handling of the page URL. When set to @@1@@ page URL will be @@...wiki.php/Main/Main@@, when set to @@0@@ (default) it will be @@...wiki.php?n=Main.Main@@.%0a%0a:$EnableFixedUrlRedirect:When PmWiki is given a partial page name (e.g., just the name of a WikiGroup), it uses $PagePathFmt in order to make a complete page name from the partial one, then issues a "redirect" to the browser to tell it to reload the page with the correct full page name. Setting %25hlt php%25@@$EnableFixedUrlRedirect=0;@@ blocks the redirect, so that PmWiki continues processing with the adjusted page name rather than issuing the redirect. %0a%0a:$GroupHeaderFmt:Defines the markup placed at the top of every page. Default value is:%0a [=$GroupHeaderFmt = '(:include {$Group}.GroupHeader self=0 basepage={*$FullName}:)(:nl:)';=]%0a%0a:$GroupPrintHeaderFmt:Defines the markup placed at the top of every page when [@action=print@]. Default value is:%0a [=SDV($GroupPrintHeaderFmt,'(:include $Group.GroupPrintHeader basepage={*$FullName}:)(:nl:)');=]%0a%0a:$GroupFooterFmt:Defines the markup placed at the bottom of every page. Default value is:%0a [=$GroupFooterFmt = '(:nl:)(:include {$Group}.GroupFooter self=0 basepage={*$FullName}:)';=]%0a%0a:$GroupPrintFooterFmt:Defines the markup placed at the bottom of every page when [@action=print@]. Default value is:%0a [=SDV($GroupPrintFooterFmt,'(:nl:)(:include $Group.GroupPrintFooter basepage={*$FullName}:)');=]%0a%0a:$PageNotFoundHeaderFmt:Specifies the HTTP header to send when attempting to browse a page that doesn't exist. Some webserver packages (notably Microsoft's "Personal Web Server") require that this variable be changed in order to work.%0a%0a-->%25hlt php%25[@%0a# default%0a$PageNotFoundHeaderFmt = 'HTTP/1.1 404 Not Found';%0a# return all pages as found%0a$PageNotFoundHeaderFmt = 'HTTP/1.1 200 Ok';%0a@]%0a%0a->Beware when expecting to return the content of a Group(header|footer) for an non existent page! By default PmWiki returns 404 (because the page does not exist), despite there is some content to show. Firefox shows the content, while Internet Explorer displays its default 404 page. $PageNotFoundHeaderFmt MUST be set to return 200 as described above in order to get the expected behaviour with all browsers.%0a%0a:$HTMLVSpace:Setting %25hlt php%25[@$HTMLVSpace = '';@]%25%25 in a local customizationfile (e.g., [@local/config.php@]) prevents insertion of spacer paragraphs (%25hlt html%25[@%3cp class='vspace'>%3c/p>@]%25%25) in generated HTML code. To limit this change to a single skin, place the %25hlt php%25[@$HTMLVSpace = '';@] statement in a @@skin.php@@ file, preceded by the statement %25hlt php%25[@global $HTMLVSpace;@].%0a%0a:$EnablePreserveLineBreaks: %0a:$HTMLPNewline:These variables allow to enable linebreaks by default, i.e. without having the directive %25pmhlt%25[@(:linebreaks:)@] in a page or in a GroupHeader. To enable line breaks, add to @@config.php@@ either one of these lines:\\%0a %25hlt php%25@@$EnablePreserveLineBreaks = 1; # equivalent to:@@\\%0a %25hlt php%25@@$HTMLPNewline = '%3cbr/>'; @@%0a%0a:$SimpleTableDefaultClassName:This variable can contain a CSS classname to be used for [[tables|simple tables]], if a "class=" attribute is not defined in the wiki page (default unset):\\%0a%25hlt php%25@@ $SimpleTableDefaultClassName = "wikisimpletable";@@\\%0aSee for sample code PITS:00638.%0a%0a:$EnableSimpleTableRowspan:If set to 0, will disable features replicating the recipe Cookbook:RowspanInSimpleTables (default enabled since 2.3.37).\\%0a@@ $EnableSimpleTableRowspan = 0; @@ # disable table rowspan markup%0a%0a:$EnableSortable:Set this variable to 0 to disable sortable tables, see [[Tables#sortable]] (default enabled since 2.3.37):\\%0a%25hlt php%25[@$EnableSortable = 0; # Disable sortable tables@]%0a%0a:$TableCellAttrFmt:For [[Tables]], defines the HTML attributes given to each @@%3ctd>@@ or @@%3cth>@@ cell in the output. Can contain references to $TableCellCount which holds the horizontal column number of the current cell.%0a%0a:$TableCellAlignFmt:For [[Tables]], defines the HTML attributes for alignment of each @@%3ctd>@@ or @@%3cth>@@ cell. Default is @@" align='%25s'"@@ where %25s will be replaced with 'center', 'left' or 'right'. For a valid HTML5 output you may want to change this in @@config.php@@:\\%0a%25hlt php%25@@$TableCellAlignFmt = " class='%25s'";@@\\%0athen define the CSS classes td.center, td.right and td.left (also th).%0a%0a:$TableRowAttrFmt:For [[Tables]], defines the HTML attributes given to each @@%3ctr>@@ element in the output. Can contain references to $TableRowCount to give the absolute row number within the table, or $TableRowIndex to provide a repeating row index from 1 to $TableRowIndexMax.%0a-> %25hlt php%25[@# Give each row a unique CSS class based on row number (tr1, tr2, tr3, ... )%0a$TableRowAttrFmt = "class='tr\$TableRowCount'";%0a# Give each row alternating CSS classes (ti1, ti2, ti1, ti2, ti1, ... )%0a$TableRowIndexMax = 2;%0a$TableRowAttrFmt = "class='ti\$TableRowIndex'"; @]%0a%0a:$TableRowIndexMax:The maximum value for $TableRowIndex in [[Tables]].%0a-> %25hlt php%25[@# Set rows indexes as 1, 2, 3, 1, 2, 3, 1, 2, ...%0a$TableRowIndexMax = 3; @]%0a%0a:$EnableTableAutoValignTop:[[TableDirectives|Advanced tables]] are intended for layout, and automatically insert the @@valign='top'@@ attribute if there is no @@valign@@ attribute defined in the markup source. Setting this variable to 0 in config.php will prevent the automatic addition.%0a-> %25hlt php%25@@$EnableTableAutoValignTop = 0; # disable automatic valign='top' attr@@%0a%0a:$EnableAutoSkinList:This variable enables the change of the [[PmWiki/skins|skin]] from the URL to any skin available on the wiki installation. See also $PageSkinList and Skins:SkinChange.%0a%0a:$PageSkinList:This is an array of allowed skins that can be changed by the visitor with @@?skin=@@ or @@?setskin=@@ URL query to the wiki. See also $EnableAutoSkinList and Skins:SkinChange.%0a%0a:$TrailFmt: An array of HTML snippets containing the layout of the [[WikiTrails]] output. If you define one or more custom values in config.php, they will be used. Here are the default values:\\%0a%25hlt php%25[@%0a$TrailFmt['%3c%3c|'] = "%3cspan class='wikitrail'><< \$prev | \$trailname | \$next >>%3c/span>";%0a$TrailFmt['%3c|'] = "%3cspan class='wikitrail'>\$prev\$trailname\$next%3c/span>";%0a$TrailFmt['^|'] = "%3cspan class='wikitrail'>\$crumbs%3c/span>";%0a@]%0a%0a:$TrailPathSep: the trail separator of the "path" trail ( %25pmhlt%25[@^|[[TrailIndexPage]]|^@] ). For instance @@$TrailPathSep = ' > ';@@ will output "[=TrailIndexPage > TrailPage2 > TrailPage4=]".%0a%0a:$InputLabelFmt: A HTML snippet containing the layout of the "label" after an input form field. If you define a custom value in config.php, it will be used. The default value has initial and trailing spaces: \\%0a%25hlt php%25[@$InputLabelFmt = ' %3clabel for="$LabelFor" $LabelTitle>$LabelText%3c/label> '; @]%0a%0a:$FmtV['$TableCellCount']:PMWiki internal variable - Horizontal column number of the current cell. For use in $TableCellAttrFmt and $TableRowAttrFmt. Administrators can use in $TableCellAttrFmt and/or $TableRowAttrFmt.%0a-> Example: %25hlt php%25@@$TableCellAttrFmt = 'class=col\$TableCellCount';@@ %0a%0a:$FmtV['$TableRowCount']:PMWiki internal variable - Current row number. Administrators can use in $TableCellAttrFmt and/or $TableRowAttrFmt.%0a-> Example: %25hlt php%25@@TableRowAttrFmt = "class='row\$TableRowCount'";@@%0a%0a:$FmtV['$TableRowIndex']:PMWiki internal variable - Row index number derived from $TableRowIndexMax. (1,2,3,1,2,3,...). Administrators can use in $TableCellAttrFmt and/or $TableRowAttrFmt.%0a-> Example: %25hlt php%25@@$TableRowAttrFmt = "class='ind\$TableRowIndex'";@@%0a%0aSee also: [[Edit Variables]]%0a +time=1724040171 diff --git a/wikilib.d/PmWiki.LinkVariables b/wikilib.d/PmWiki.LinkVariables index e0dd6a49..a5472a2f 100644 --- a/wikilib.d/PmWiki.LinkVariables +++ b/wikilib.d/PmWiki.LinkVariables @@ -1,9 +1,9 @@ -version=pmwiki-2.3.29 ordered=1 urlencoded=1 -author=simon +version=pmwiki-2.3.36 ordered=1 urlencoded=1 +author=Petko charset=UTF-8 -csum=hlt (+171) +csum=$EnableObfuscateEmails (+236) name=PmWiki.LinkVariables -rev=78 +rev=79 targets=PmWiki.LinkVariables,PmWiki.Links,PmWiki.PageVariables,Cookbook.PagePaths,PmWiki.BasicVariables,PmWiki.InterMap,Cookbook.DotsInLinks,PmWiki.PageDirectives,Category.PmWikiDeveloper,!PmWikiDeveloper -text=(:Summary:variables that control the display of links in pages:)%0a(:Audience: admins (advanced):)%0a:$EnableLinkPageRelative:When enabled, causes PmWiki to use relative urls for page links instead of absolute urls.%0a-> %25hlt php%25@@$EnableLinkPageRelative = 1;@@%0a%0a:$EnableLinkPlusTitlespaced: When enabled, a [[links|link]] written like %25pmhlt%25[@[[Name|+]]@] will display the "Spaced Title". Default is to display the "Title" of the page. See the page [[PageVariables]] for [@{$Title}@] and [@{$Titlespaced}@].%0a%0a:$PagePathFmt: This array lists the order in which PmWiki looks for the page that you ''most likely'' are attempting to link to. The default is listed below. Look at Cookbook:PagePaths for some ideas.%0a-> %25hlt php%25[@array('{$Group}.$1', '$1.$1', '$1.{$DefaultName}')@]%0a%0a:$LinkPageExistsFmt:The (HTML) string to output for links to already existing wiki pages. Defaults to %0a-> %25hlt html%25[@%3ca class='wikilink' href='\$LinkUrl'>\$LinkText%3c/a>@]%0a%0a:$LinkPageCreateFmt:The (HTML) string to output for links to non-existent wiki pages. The default is to add a '?' after the link text with a link to the page edit/create form. Defaults to%0a-> %25hlt html%25[@%3ca class='createlinktext' href='\$PageUrl?action=edit'>\$LinkText%3c/a>@]%0a-> %25hlt html%25[@%3ca class='createlink' href='\$PageUrl?action=edit'>?%3c/a>@]%0a%0a:$LinkPageCreateSpaceFmt:Same as $LinkPageCreateFmt, but used when the link text has a space in it. %0a%0a:$LinkPageSelfFmt:The (HTML) string to output for self-referencing links (i.e. links to the page itself). Defaults to%0a-> %25hlt html%25[@%3ca class='selflink' href='\$LinkUrl'>\$LinkText%3c/a>@]%0a%0a:$LinkCategoryFmt:The (HTML) string to output for links to wiki category pages. Defaults to %0a-> %25hlt html%25[@%3ca class='categorylink' href='\$LinkUrl'>\$LinkText%3c/a>@]%0a%0a%0a:$UrlLinkFmt:The (HTML) string to output for URL-links that begin with 'http:', 'ftp:', etc. Defaults to%0a-> %25hlt html%25[@%3ca class='urllink' href='\$LinkUrl' title='\$LinkAlt' rel='nofollow'>\$LinkText%3c/a>@]%0a-> All InterMap links default to $UrlLinkFmt, unless there is a specific $IMapLinkFmt entry.%0a%0a:$IMapLinkFmt: an array of link formats for various link "schemes". Not set as default.%0a->Examples of custom formats to allow different styling via classes: %0a->Links to http: insecure url links:%0a--> %25hlt php%25[@$IMapLinkFmt['http:'] = "%3ca class='httplink urllink' href='\$LinkUrl'>\$LinkText%3c/a>"; @] %0a->Links to https: secure pages:%0a--> %25hlt php%25[@$IMapLinkFmt['https:'] = "%3ca class='httpslink urllink' href='\$LinkUrl'>\$LinkText%3c/a>"; @] %0a->Links to PmWiki: InterMap shortcut:%0a--> %25hlt php%25[@$IMapLinkFmt['PmWiki:'] = "%3ca class='pmwikilink urllink' href='\$LinkUrl'>\$LinkText%3c/a>";@]%0a->Note that if you have enabled ObfuscateLinkIMap (core function based on DeObMail), the snippet can be customized in:%0a--> %25hlt php%25[@$IMapLinkFmt['obfuscate-mailto:'] @]%0a->The default (for ObfuscateLinkIMap) is:%0a--> %25hlt php%25[@$IMapLinkFmt['obfuscate-mailto:'] = "%3cspan class='_pmXmail' title=\"\$LinkAlt\">%3cspan class='_t'>\$LinkText%3c/span>%3cspan class='_m'>\$LinkUrl%3c/span>%3c/span>"; @]%0a->The @@ObfuscateLinkIMap@@ logic expects the snippet to have some recognisable properties -- classes, elements, otherwise it may not work. Start with the default snippet, make small modifications, and test if it works.%0a%0a:$AddLinkCSS:An array of additional custom link CSS classes, that are added to the link format $UrlLinkFmt, $IMapLinkFmt or $LinkPageExistsFmt. Currently can have 2 elements:\\%0a%25hlt php%25@@$AddLinkCSS['othergroup'] = "''crossgroup''"; # add "''crossgroup''" class to wikilinks to other wikigroups @@ \\%0a%25hlt php%25@@$AddLinkCSS['samedomain'] = "''currentsite''"; # add "''currentsite''" class to URL or Path links to resources on the same domain. @@%0a%0a:$InterMapFiles:An array consisting a list of files and pages containing [[InterMap]] entries to be loaded.%0a%0a:$MakePageNameFunction:Name of a custom function to replace %25hlt php%25[@MakePageName()@], which converts strings into valid page names.%0a%0a:$MakePageNamePatterns: $MakePageNamePatterns is an array of regular expression replacements that is used to map the page link in a ''free link'' such as %25pmhlt%25[@[[free link]]@] into a page name. Currently the default sequence is: %25hlt php%25[@%0a "/'/" => '', # strip single-quotes%0a "/[^$PageNameChars]+/" => ' ', # convert to spaces characters not allowed in pagenames%0a '/((^|[^-\\w])\\w)/' => 'cb_toupper', # capitalize 1st letter of words%0a '/ /' => '' # remove spaces%0a@]%0a: :Note that if you change $MakePageNamePatterns, the documentation links may break. This can be fixed by re-setting $MakePageNamePatterns to the default in @@local/PmWiki.php@@.%0a%0a:$MakePageNameSplitPattern:See Cookbook:DotsInLinks.%0a%0a:$WikiWordCountMax:The maximum number of times to convert each WikiWord encountered on a page. Defaults to 1,000,000. Common settings for this variable are zero (disable WikiWord links) and one (convert only the first occurrence of each WikiWord).%0a-> %25hlt php%25@@$WikiWordCountMax = 0; # disable WikiWord links@@%0a-> %25hlt php%25@@$WikiWordCountMax = 1; # convert only first WikiWord@@%0a%0a:$WikiWordCount:An array that allows the number of WikiWord conversions to be set on a per-WikiWord basis. The default is to use $WikiWordCountMax unless a value is set in this array. By default PmWiki sets %25hlt php%25@@$WikiWordCount['PmWiki']=1@@ to limit the number of conversions of "PmWiki".%0a-> %25hlt php%25[@$WikiWordCount[=['PhD']=0; # Don't convert "PhD"=]%0a$WikiWordCount['WikiWord']=5; # Convert WikiWord 5 times%0a# the following lines keep a page from linking to itself%0a$title = [=FmtPageName=]('$Title_',$pagename);%0a$WikiWordCount[$title]=0; @]%0a %0a:$EnableRedirectQuiet:Enable the @@quiet=1@@ parameter for the [[PmWiki.PageDirectives#redirect|redirect directive]]. On publicly edited wikis it is advisable not to enable quiet redirects.%0a-> %25hlt php%25@@$EnableRedirectQuiet = 0; # disable quiet redirects (default) @@%0a-> %25hlt php%25@@$EnableRedirectQuiet = 1; # enable quiet redirects with quiet=1 @@%0a-> %25hlt php%25@@$EnableRedirectQuiet = 2; # enable quiet redirects unless quiet=0 @@%0a%0a:$QualifyPatterns:An array of regular expression replacements applied when text from one page is included in another, used by the function %25hlt php%25@@Qualify()@@. The two default patterns rewrite links like %25pmhlt%25[@[[Page]]@] into [@[[Group/Page]]@], and page (text) variables like [@{$Title}@] into [@{Group.Page$Title}@] so that they work the same way in the source page and in the including page.%0a%0aCategories: [[!PmWiki Developer]] -time=1705175668 +text=(:Summary:variables that control the display of links in pages:)%0a(:Audience: admins (advanced):)%0a:$EnableLinkPageRelative:When enabled, causes PmWiki to use relative urls for page links instead of absolute urls.%0a-> %25hlt php%25@@$EnableLinkPageRelative = 1;@@%0a%0a:$EnableLinkPlusTitlespaced: When enabled, a [[links|link]] written like %25pmhlt%25[@[[Name|+]]@] will display the "Spaced Title". Default is to display the "Title" of the page. See the page [[PageVariables]] for [@{$Title}@] and [@{$Titlespaced}@].%0a%0a:$EnableObfuscateEmails: If set to 1, will enable email obfuscation that makes it less likely for spambots to collect addresses from the wiki. It is equivalent to setting:\\%0a%25hlt php%25[@$LinkFunctions['mailto:'] = 'ObfuscateLinkIMap';@]%0a%0a:$PagePathFmt: This array lists the order in which PmWiki looks for the page that you ''most likely'' are attempting to link to. The default is listed below. Look at Cookbook:PagePaths for some ideas.%0a-> %25hlt php%25[@array('{$Group}.$1', '$1.$1', '$1.{$DefaultName}')@]%0a%0a:$LinkPageExistsFmt:The (HTML) string to output for links to already existing wiki pages. Defaults to %0a-> %25hlt html%25[@%3ca class='wikilink' href='\$LinkUrl'>\$LinkText%3c/a>@]%0a%0a:$LinkPageCreateFmt:The (HTML) string to output for links to non-existent wiki pages. The default is to add a '?' after the link text with a link to the page edit/create form. Defaults to%0a-> %25hlt html%25[@%3ca class='createlinktext' href='\$PageUrl?action=edit'>\$LinkText%3c/a>@]%0a-> %25hlt html%25[@%3ca class='createlink' href='\$PageUrl?action=edit'>?%3c/a>@]%0a%0a:$LinkPageCreateSpaceFmt:Same as $LinkPageCreateFmt, but used when the link text has a space in it. %0a%0a:$LinkPageSelfFmt:The (HTML) string to output for self-referencing links (i.e. links to the page itself). Defaults to%0a-> %25hlt html%25[@%3ca class='selflink' href='\$LinkUrl'>\$LinkText%3c/a>@]%0a%0a:$LinkCategoryFmt:The (HTML) string to output for links to wiki category pages. Defaults to %0a-> %25hlt html%25[@%3ca class='categorylink' href='\$LinkUrl'>\$LinkText%3c/a>@]%0a%0a:$UrlLinkFmt:The (HTML) string to output for URL-links that begin with 'http:', 'ftp:', etc. Defaults to%0a-> %25hlt html%25[@%3ca class='urllink' href='\$LinkUrl' title='\$LinkAlt' rel='nofollow'>\$LinkText%3c/a>@]%0a-> All InterMap links default to $UrlLinkFmt, unless there is a specific $IMapLinkFmt entry.%0a%0a:$IMapLinkFmt: an array of link formats for various link "schemes". Not set as default.%0a->Examples of custom formats to allow different styling via classes: %0a->Links to http: insecure url links:%0a--> %25hlt php%25[@$IMapLinkFmt['http:'] = "%3ca class='httplink urllink' href='\$LinkUrl'>\$LinkText%3c/a>"; @] %0a->Links to https: secure pages:%0a--> %25hlt php%25[@$IMapLinkFmt['https:'] = "%3ca class='httpslink urllink' href='\$LinkUrl'>\$LinkText%3c/a>"; @] %0a->Links to PmWiki: InterMap shortcut:%0a--> %25hlt php%25[@$IMapLinkFmt['PmWiki:'] = "%3ca class='pmwikilink urllink' href='\$LinkUrl'>\$LinkText%3c/a>";@]%0a->Note that if you have enabled ObfuscateLinkIMap (core function based on DeObMail), the snippet can be customized in:%0a--> %25hlt php%25[@$IMapLinkFmt['obfuscate-mailto:'] @]%0a->The default (for ObfuscateLinkIMap) is:%0a--> %25hlt php%25[@$IMapLinkFmt['obfuscate-mailto:'] = "%3cspan class='_pmXmail' title=\"\$LinkAlt\">%3cspan class='_t'>\$LinkText%3c/span>%3cspan class='_m'>\$LinkUrl%3c/span>%3c/span>"; @]%0a->The @@ObfuscateLinkIMap@@ logic expects the snippet to have some recognisable properties -- classes, elements, otherwise it may not work. Start with the default snippet, make small modifications, and test if it works.%0a%0a:$AddLinkCSS:An array of additional custom link CSS classes, that are added to the link format $UrlLinkFmt, $IMapLinkFmt or $LinkPageExistsFmt. Currently can have 2 elements:\\%0a%25hlt php%25@@$AddLinkCSS['othergroup'] = "''crossgroup''"; # add "''crossgroup''" class to wikilinks to other wikigroups @@ \\%0a%25hlt php%25@@$AddLinkCSS['samedomain'] = "''currentsite''"; # add "''currentsite''" class to URL or Path links to resources on the same domain. @@%0a%0a:$InterMapFiles:An array consisting a list of files and pages containing [[InterMap]] entries to be loaded.%0a%0a:$MakePageNameFunction:Name of a custom function to replace %25hlt php%25[@MakePageName()@], which converts strings into valid page names.%0a%0a:$MakePageNamePatterns: $MakePageNamePatterns is an array of regular expression replacements that is used to map the page link in a ''free link'' such as %25pmhlt%25[@[[free link]]@] into a page name. Currently the default sequence is: %25hlt php%25[@%0a "/'/" => '', # strip single-quotes%0a "/[^$PageNameChars]+/" => ' ', # convert to spaces characters not allowed in pagenames%0a '/((^|[^-\\w])\\w)/' => 'cb_toupper', # capitalize 1st letter of words%0a '/ /' => '' # remove spaces%0a@]%0a: :Note that if you change $MakePageNamePatterns, the documentation links may break. This can be fixed by re-setting $MakePageNamePatterns to the default in @@local/PmWiki.php@@.%0a%0a:$MakePageNameSplitPattern:See Cookbook:DotsInLinks.%0a%0a:$WikiWordCountMax:The maximum number of times to convert each WikiWord encountered on a page. Defaults to 1,000,000. Common settings for this variable are zero (disable WikiWord links) and one (convert only the first occurrence of each WikiWord).%0a-> %25hlt php%25@@$WikiWordCountMax = 0; # disable WikiWord links@@%0a-> %25hlt php%25@@$WikiWordCountMax = 1; # convert only first WikiWord@@%0a%0a:$WikiWordCount:An array that allows the number of WikiWord conversions to be set on a per-WikiWord basis. The default is to use $WikiWordCountMax unless a value is set in this array. By default PmWiki sets %25hlt php%25@@$WikiWordCount['PmWiki']=1@@ to limit the number of conversions of "PmWiki".%0a-> %25hlt php%25[@$WikiWordCount[=['PhD']=0; # Don't convert "PhD"=]%0a$WikiWordCount['WikiWord']=5; # Convert WikiWord 5 times%0a# the following lines keep a page from linking to itself%0a$title = [=FmtPageName=]('$Title_',$pagename);%0a$WikiWordCount[$title]=0; @]%0a %0a:$EnableRedirectQuiet:Enable the @@quiet=1@@ parameter for the [[PmWiki.PageDirectives#redirect|redirect directive]]. On publicly edited wikis it is advisable not to enable quiet redirects.%0a-> %25hlt php%25@@$EnableRedirectQuiet = 0; # disable quiet redirects (default) @@%0a-> %25hlt php%25@@$EnableRedirectQuiet = 1; # enable quiet redirects with quiet=1 @@%0a-> %25hlt php%25@@$EnableRedirectQuiet = 2; # enable quiet redirects unless quiet=0 @@%0a%0a:$QualifyPatterns:An array of regular expression replacements applied when text from one page is included in another, used by the function %25hlt php%25@@Qualify()@@. The two default patterns rewrite links like %25pmhlt%25[@[[Page]]@] into [@[[Group/Page]]@], and page (text) variables like [@{$Title}@] into [@{Group.Page$Title}@] so that they work the same way in the source page and in the including page.%0a%0aCategories: [[!PmWiki Developer]] +time=1724039576 diff --git a/wikilib.d/PmWiki.OtherVariables b/wikilib.d/PmWiki.OtherVariables index b10fe4c9..4556e485 100644 --- a/wikilib.d/PmWiki.OtherVariables +++ b/wikilib.d/PmWiki.OtherVariables @@ -1,9 +1,9 @@ -version=pmwiki-2.3.29 ordered=1 urlencoded=1 -author=MFWolff +version=pmwiki-2.3.36 ordered=1 urlencoded=1 +author=Petko charset=UTF-8 -csum=hlt php (+18) +csum= $EnableUrlApprove, $EnablePmForm, $EnableCreole, $EnableRefCount, $EnableFeeds (+369) name=PmWiki.OtherVariables -rev=93 -targets=PmWiki.OtherVariables,PmWiki.FmtPageName,PmWiki.SecurityVariables,PmWiki.PageVariables,PmWiki.Functions,Cookbook.HttpVariables,Cookbook.MoreCustomPageVariables,PmWiki.PageTextVariables,PmWiki.PagelistVariables,PmWiki.Forms,Cookbook.MarkupDirectiveFunctions -text=(:Summary:Variables not yet classified:)%0a:$FmtV: %0a: :This variable is an array that is used for string substitutions at the end of a call to %25hlt php%25@@[[FmtPageName]]()@@. For each element in the array, the "key" (interpreted as a string) will be replaced by the corresponding "value". The variable is intended to be a place to store substitution variables that have frequently changing values (thus avoiding a rebuild of the variable cache making @@[[FmtPageName]]()@@ faster). Also see $FmtP. %0a: :%25green%25''Values of $FmtV are set by the internal functions @@FormatTableRow@@, @@LinkIMap@@, @@HandleBrowse@@, PreviewPage, @@HandleEdit@@, @@PmWikiAuth@@, and @@PasswdVar@@, apparently to set values for system generated string substitutions like @@PageText@@.''%25%25%0a%0a:$FmtP:%0a: :This variable is an array that is used for pattern substitutions near the beginning of a call to %25hlt php%25[@FmtPageName()@]. For each element in the array, the "key" (interpreted as a pattern) will be replaced by the corresponding value evaluated for the name of the current page. This is for instance used to handle $-substitutions that depend on the pagename passed to [@FmtPageName()@]. Also see $FmtV. %0a: :%25green%25From @@robots.php@@: ''If $EnableRobotCloakActions is set, then a pattern is added to $FmtP to hide any "?action=" url parameters in page urls generated by PmWiki for actions that robots aren't allowed to access. This can greatly reduce the load on the server by not providing the robot with links to pages that it will be forbidden to index anyway.''%0a%0a%0a:$FmtPV:%0a: :This variable is an array that is used for defining [[Page Variables]]. New variables can be defined with %25hlt php%25[@$FmtPV['$VarName'] = 'variable definition';@] which can be used in markup with %25pmhlt%25[@{$VarName}@]. Please note that the contents of %25hlt php%25[@$FmtPV['$VarName']@] are [@eval()@]ed to produce the final text for %25pmhlt%25[@$VarName@], so the contents must be a PHP expression which is valid at the time of substitution. In particular, %25red%25this does not work:%25%25%0a%0a:: :%25red%25@@#This doesn't work@@%25%25%0a:: :%25hlt php%25@@$FmtPV['$MyText'] = "This is my text."; # WARNING: Doesn't work!@@%0a%0a: :The problem is that the text %25blue%25[@This is my text.@]%25%25 is not a valid PHP expression. To work it would need to be placed in quotes, so that what actually gets stored in %25hlt php%25[@$FmtPV['$MyText']@] is %25blue%25[@"This is my text."@]%25%25 which '''is''' a valid PHP expression for a text string. Thus the correct way to do this would be with an extra set of quotes:%0a%0a:: :%25green%25@@#This will work@@%25%25%0a:: :%25hlt php%25@@$FmtPV['$MyText'] = '"This is my text."';@@%0a%0a: :This also has implications for how internal PHP or PmWiki variables are accessed. To have the page variable %25hlt php%25[@$MyVar@] produce the contents of the internal variable [@$myvar@], many folks try the following %25red%25which does not work:%25%25%0a%0a:: :%25red%25@@#This doesn't work either!@@%0a:: :%25hlt php%25@@$myvar = SomeComplexFunction();@@%0a:: :%25hlt php%25@@$FmtPV['$MyVar'] = $myvar; # WARNING: Doesn't work!@@%0a%0a: :There are several correct ways to do this, depending on whether you need the value of the %25hlt php%25[@$myvar@] variable as it was at the time the [@$FmtPV@] entry was created, or at the time that a particular instance of [@$MyVar@] is being rendered on a page. For most simple page variables that don't change during the processing of a page its more efficient to set the value when the entry is created:%0a%0a:: :%25hlt php%25@@$myvar = SomeComplexFunction();@@%0a:: :%25hlt php%25@@$FmtPV['$MyVar'] = "'" . $myvar . "'"; #capture contents of $myvar@@%0a%0a: :NOTE: If %25hlt php%25[@$myvar@] should contain single quotes, the above won't work as is, and you'll need to process the variable to escape any internal quotes.%0a%0a: :For more complex cases where an internal variable may have different values at different places in the page (possibly due to the effects of other markup), then you need to make the %25hlt php%25[@$FmtPV@] entry make an explicit reference to the global value of the variable (and the variable had better be global) like this:%0a%0a:: :%25hlt php%25@@global $myvar;@@%0a:: :%25hlt php%25@@$FmtPV['$MyVar'] = '$GLOBALS["myvar"]';@@%0a%0a: :Finally, there's nothing to stop you from simply having the evaluation of the %25hlt php%25[@$FmtPV@] entry execute a function to determine the replacement text:%0a%0a:: :%25hlt php%25@@# add page variable [={$Today}=], formats today's date as yyyy-mm-dd@@%0a:: :%25hlt php%25@@$FmtPV['$Today'] = '[[PmWiki/Functions#PSFT|PSFT]]([="%25Y-%25m-%25d"=], time() )';@@%0a%0a>>frame%3c%3c%0a: : Once again, please note that the values of the elements of $FmtPV are @@eval()@@ed so always sanitize any user input. The following is very insecure[=:=]%0a%0a:: : %25hlt php%25@@$FmtPV['$Var'] = $_REQUEST['Var'];@@ %25red%25@@# critically insecure, allows PHP code injection@@%0a:: : %25hlt php%25@@$FmtPV['$Var'] = '"'. addslashes($_REQUEST['Var']).'"';@@ %25red%25@@# critically insecure, allows PHP code injection@@%0a%0a: : See the recipe Cookbook:HttpVariables for a better way to use these variables.%0a>>%3c%3c%0a%0a: :See [[Cookbook:MoreCustomPageVariables]] for more examples of how to use [@$FmtPV@].%0a%0a:$MaxPageTextVars: This variable prevents endless loops in accidental recursive [[PageTextVariables]] which could lock down a server. Default is 500 which means that each PageTextVariable from one page can be displayed up to 500 times in one wiki page. If you need to display it more than 500 times, set in @@config.php@@ something like%0a-->%25hlt php%25@@$MaxPageTextVars = 10000;@@ # ten thousand times%0a%0a:$DefaultUnsetPageTextVars: An array setting default values to page text variables which are not defined in the page, or when the user doesn't have read permissions for the page. See [[PageTextVariables#default]].%0a%0a:$DefaultEmptyPageTextVars: An array setting default values to page text variables which are defined in the page but empty. See [[PageTextVariables#default]].%0a%0a:$PageCacheDir: Enables the cache of most of the HTML for pages with no conditionals. The variable contains the name of a writable directory where PmWiki can cache the HTML output to speed up subsequent displays of the same page. Default is empty, which disables the cache. See also $PageListCacheDir.%0a-->%25hlt php%25[@# Enable HTML caching in work.d/.pagecache%0a$PageCacheDir = 'work.d/.pagecache'; @]%0a%0a:$MarkupMarkupLevel: This global variable is a positive integer when the markup processing engine is inside a %25pmhlt%25[@(:markup:)@] block; it is 0 (zero) or null otherwise.%0a%0a:$EnableInputDataAttr: This variable controls whether [[forms|input form elements]] should accept custom @@data-*@@ attributes. By default they do.%0a-->%25hlt php%25[@# Disable data-* attributes in forms%0a$EnableInputDataAttr = 0; @]%0a%0a:$MarkupDirectiveFunctions: This is an array that allows recipe authors to easily configure custom directives. See Cookbook:MarkupDirectiveFunctions.%0a -time=1703408268 +rev=95 +targets=PmWiki.UrlApprovals,PmWiki.OtherVariables,Cookbook.PmForm,Cookbook.Creole,PmWiki.RefCount,PmWiki.WebFeeds,PmWiki.FmtPageName,PmWiki.SecurityVariables,PmWiki.PageVariables,PmWiki.Functions,Cookbook.HttpVariables,Cookbook.MoreCustomPageVariables,PmWiki.PageTextVariables,PmWiki.PagelistVariables,PmWiki.Forms,Cookbook.MarkupDirectiveFunctions +text=(:Summary:Variables not yet classified:)%0a%0a:$EnableUrlApprove: When set to 1, enables [[UrlApprovals]].%0a%0a:$EnablePmForm: When set to 1, enables Cookbook:PmForm.%0a%0a:$EnableCreole: When set to 1, enables Cookbook:Creole.%0a%0a:$EnableRefCount: When set to 1, enables [[RefCount]].%0a%0a:$EnableFeeds: An array enabling RSS and other web feeds, see [[WebFeeds]].\\%0a%25hlt php%25@@$EnableFeeds['rss'] = 1; # enable RSS feeds@@%0a%0a:$FmtV: %0a: :This variable is an array that is used for string substitutions at the end of a call to %25hlt php%25@@[[FmtPageName]]()@@. For each element in the array, the "key" (interpreted as a string) will be replaced by the corresponding "value". The variable is intended to be a place to store substitution variables that have frequently changing values (thus avoiding a rebuild of the variable cache making @@[[FmtPageName]]()@@ faster). Also see $FmtP. %0a: :%25green%25''Values of $FmtV are set by the internal functions @@FormatTableRow@@, @@LinkIMap@@, @@HandleBrowse@@, PreviewPage, @@HandleEdit@@, @@PmWikiAuth@@, and @@PasswdVar@@, apparently to set values for system generated string substitutions like @@PageText@@.''%25%25%0a%0a:$FmtP:%0a: :This variable is an array that is used for pattern substitutions near the beginning of a call to %25hlt php%25[@FmtPageName()@]. For each element in the array, the "key" (interpreted as a pattern) will be replaced by the corresponding value evaluated for the name of the current page. This is for instance used to handle $-substitutions that depend on the pagename passed to [@FmtPageName()@]. Also see $FmtV. %0a: :%25green%25From @@robots.php@@: ''If $EnableRobotCloakActions is set, then a pattern is added to $FmtP to hide any "?action=" url parameters in page urls generated by PmWiki for actions that robots aren't allowed to access. This can greatly reduce the load on the server by not providing the robot with links to pages that it will be forbidden to index anyway.''%0a%0a%0a:$FmtPV:%0a: :This variable is an array that is used for defining [[Page Variables]]. New variables can be defined with %25hlt php%25[@$FmtPV['$VarName'] = 'variable definition';@] which can be used in markup with %25pmhlt%25[@{$VarName}@]. Please note that the contents of %25hlt php%25[@$FmtPV['$VarName']@] are [@eval()@]ed to produce the final text for %25pmhlt%25[@$VarName@], so the contents must be a PHP expression which is valid at the time of substitution. In particular, %25red%25this does not work:%25%25%0a%0a:: :%25red%25@@#This doesn't work@@%25%25%0a:: :%25hlt php%25@@$FmtPV['$MyText'] = "This is my text."; # WARNING: Doesn't work!@@%0a%0a: :The problem is that the text %25blue%25[@This is my text.@]%25%25 is not a valid PHP expression. To work it would need to be placed in quotes, so that what actually gets stored in %25hlt php%25[@$FmtPV['$MyText']@] is %25blue%25[@"This is my text."@]%25%25 which '''is''' a valid PHP expression for a text string. Thus the correct way to do this would be with an extra set of quotes:%0a%0a:: :%25green%25@@#This will work@@%25%25%0a:: :%25hlt php%25@@$FmtPV['$MyText'] = '"This is my text."';@@%0a%0a: :This also has implications for how internal PHP or PmWiki variables are accessed. To have the page variable %25hlt php%25[@$MyVar@] produce the contents of the internal variable [@$myvar@], many folks try the following %25red%25which does not work:%25%25%0a%0a:: :%25red%25@@#This doesn't work either!@@%0a:: :%25hlt php%25@@$myvar = SomeComplexFunction();@@%0a:: :%25hlt php%25@@$FmtPV['$MyVar'] = $myvar; # WARNING: Doesn't work!@@%0a%0a: :There are several correct ways to do this, depending on whether you need the value of the %25hlt php%25[@$myvar@] variable as it was at the time the [@$FmtPV@] entry was created, or at the time that a particular instance of [@$MyVar@] is being rendered on a page. For most simple page variables that don't change during the processing of a page its more efficient to set the value when the entry is created:%0a%0a:: :%25hlt php%25@@$myvar = SomeComplexFunction();@@%0a:: :%25hlt php%25@@$FmtPV['$MyVar'] = "'" . $myvar . "'"; #capture contents of $myvar@@%0a%0a: :NOTE: If %25hlt php%25[@$myvar@] should contain single quotes, the above won't work as is, and you'll need to process the variable to escape any internal quotes.%0a%0a: :For more complex cases where an internal variable may have different values at different places in the page (possibly due to the effects of other markup), then you need to make the %25hlt php%25[@$FmtPV@] entry make an explicit reference to the global value of the variable (and the variable had better be global) like this:%0a%0a:: :%25hlt php%25@@global $myvar;@@%0a:: :%25hlt php%25@@$FmtPV['$MyVar'] = '$GLOBALS["myvar"]';@@%0a%0a: :Finally, there's nothing to stop you from simply having the evaluation of the %25hlt php%25[@$FmtPV@] entry execute a function to determine the replacement text:%0a%0a:: :%25hlt php%25@@# add page variable [={$Today}=], formats today's date as yyyy-mm-dd@@%0a:: :%25hlt php%25@@$FmtPV['$Today'] = '[[PmWiki/Functions#PSFT|PSFT]]([="%25Y-%25m-%25d"=], time() )';@@%0a%0a>>frame%3c%3c%0a: : Once again, please note that the values of the elements of $FmtPV are @@eval()@@ed so always sanitize any user input. The following is very insecure[=:=]%0a%0a:: : %25hlt php%25@@$FmtPV['$Var'] = $_REQUEST['Var'];@@ %25red%25@@# critically insecure, allows PHP code injection@@%0a:: : %25hlt php%25@@$FmtPV['$Var'] = '"'. addslashes($_REQUEST['Var']).'"';@@ %25red%25@@# critically insecure, allows PHP code injection@@%0a%0a: : See the recipe Cookbook:HttpVariables for a better way to use these variables.%0a>>%3c%3c%0a%0a: :See [[Cookbook:MoreCustomPageVariables]] for more examples of how to use [@$FmtPV@].%0a%0a:$MaxPageTextVars: This variable prevents endless loops in accidental recursive [[PageTextVariables]] which could lock down a server. Default is 500 which means that each PageTextVariable from one page can be displayed up to 500 times in one wiki page. If you need to display it more than 500 times, set in @@config.php@@ something like%0a-->%25hlt php%25@@$MaxPageTextVars = 10000;@@ # ten thousand times%0a%0a:$DefaultUnsetPageTextVars: An array setting default values to page text variables which are not defined in the page, or when the user doesn't have read permissions for the page. See [[PageTextVariables#default]].%0a%0a:$DefaultEmptyPageTextVars: An array setting default values to page text variables which are defined in the page but empty. See [[PageTextVariables#default]].%0a%0a:$PageCacheDir: Enables the cache of most of the HTML for pages with no conditionals. The variable contains the name of a writable directory where PmWiki can cache the HTML output to speed up subsequent displays of the same page. Default is empty, which disables the cache. See also $PageListCacheDir.%0a-->%25hlt php%25[@# Enable HTML caching in work.d/.pagecache%0a$PageCacheDir = 'work.d/.pagecache'; @]%0a%0a:$MarkupMarkupLevel: This global variable is a positive integer when the markup processing engine is inside a %25pmhlt%25[@(:markup:)@] block; it is 0 (zero) or null otherwise.%0a%0a:$EnableInputDataAttr: This variable controls whether [[forms|input form elements]] should accept custom @@data-*@@ attributes. By default they do.%0a-->%25hlt php%25[@# Disable data-* attributes in forms%0a$EnableInputDataAttr = 0; @]%0a%0a:$MarkupDirectiveFunctions: This is an array that allows recipe authors to easily configure custom directives. See Cookbook:MarkupDirectiveFunctions.%0a +time=1724044378 diff --git a/wikilib.d/PmWiki.PageVariables b/wikilib.d/PmWiki.PageVariables index 5df34b2d..ade5ef39 100644 --- a/wikilib.d/PmWiki.PageVariables +++ b/wikilib.d/PmWiki.PageVariables @@ -1,12 +1,12 @@ -version=pmwiki-2.3.13 ordered=1 urlencoded=1 +version=pmwiki-2.3.36 ordered=1 urlencoded=1 author=Petko charset=UTF-8 -csum=markup expressions can process page variables (-26) +csum=fix wiki link in code, move link below, "ctime" is recent (+121) ctime=1135816487 description=Documentation for "variables" that are associated with pages. name=PmWiki.PageVariables -rev=127 -targets=PmWiki.PageVariables,PmWiki.Variables,Cookbook.Functions,PmWiki.FmtPageName,PmWiki.BasicVariables,PmWiki.MarkupExpressions,Site.PageNotFound,PmWiki.IncludeOtherPages,PmWiki.PageLists,PmWiki.PageTextVariables,PmWiki.PageListTemplates,PmWiki.OtherVariables,PmWiki.ConditionalMarkup,Cookbook.HttpVariables,Cookbook.MoreCustomPageVariables,PmWiki.MarkupMasterIndex,Category.PmWikiDeveloper,!PmWikiDeveloper -text=(:title Page specific variables:)%0a(:description Documentation for "variables" that are associated with pages. :)%0a(:Summary: variables that are associated with pages:)%0a(:Audience: authors (intermediate) :)%0a%0a[[#desc]]This page describes the "[[variables]]" that are associated with pages. Page variables have the form %25pmhlt%25[@{$variable}@], and can be used in page markup or in certain formatting strings in PmWiki. For example, the markup "[@{$Group}@]" renders in this page as "{$Group}".%0a%0aNote: Do not confuse these variables (set and used only in PmWiki pages) with [[PmWiki/Variables|PHP variables]]. Page variables can be read in PHP with the [[Cookbook:Functions#PageVar|PageVar()]] function.%0a%0aNote that these variables do not necessarily exist in the PHP code, because they have to be determined for a specific page. (However, they are usable in [[FmtPageName]] strings.)%0a%0a%25pmhlt%25There is also the form [@{pagename$variable}@], which returns the value of the variable for another page. For example, "[@{MarkupMasterIndex$Title}@]" displays as "{MarkupMasterIndex$Title}".%0a%0a%0a!! Default page variables%0a%0aThe page variables defined for PmWiki are:%0a%0a->%25pmhlt%25[@{$Action}@] - page's url action argument, as in "{$Action}"%0a->%25pmhlt%25[@{$BaseName}@] - page's "base" form (stripping any prefixes or suffixes defined via @@$BaseNamePatterns@@) as in "`{$BaseName}"%0a->%25pmhlt%25[@{$DefaultGroup}@] - default group name, as in "{$DefaultGroup}"%0a->%25pmhlt%25[@{$DefaultName}@] - name of default page, as in "`{$DefaultName}" (take note also of $PagePathFmt for setting a homepage for a group)%0a->%25pmhlt%25[@{$Description}@] - page's description from the [@(:description:)@] markup, as in "{$Description}"%0a->%25pmhlt%25[@{$FullName}@] - page's full name, as in "`{$FullName}"%0a->%25pmhlt%25[@{$Group}@] - page's group name, as in "`{$Group}"%0a->%25pmhlt%25[@{$Groupspaced}@] - spaced group name, as in "{$Groupspaced}"%0a%0a->%25pmhlt%25[@{$LastModified}@] - date page was edited, as in "{$LastModified}"%0a->%25pmhlt%25[@{$LastModifiedBy}@] - page's last editor, as in "{$LastModifiedBy}"%0a->%25pmhlt%25[@{$LastModifiedHost}@] - IP of page's last editor, as in "{$LastModifiedHost}"%0a->%25pmhlt%25[@{$LastModifiedSummary}@] - Summary from last edit, as in "{$LastModifiedSummary}"%0a->%25pmhlt%25[@{$LastModifiedTime}@] - time page was edited in unix-style timestamp, as in "{$LastModifiedTime}"%0a-->%25pmhlt%25This can be used (preceded by '@') in [[PmWiki.MarkupExpressions#ftime|[@{(ftime)}@]]] and other date/time markups.%0a%0a->%25pmhlt%25[@{$Name}@] - page name, as in "`{$Name}"%0a->%25pmhlt%25[@{$Namespaced}@] - spaced page name, as in "{$Namespaced}"%0a->%25pmhlt%25[@{$PageUrl}@] - page's url, as in "{$PageUrl}"%0a->%25pmhlt%25[@{$PasswdRead}@] - "read" permissions for the page e.g. "{$PasswdRead}"%0a->%25pmhlt%25[@{$PasswdEdit}@] - "edit" permissions for the page e.g. "{$PasswdEdit}"%0a->%25pmhlt%25[@{$PasswdAttr}@] - "attr" permissions for the page e.g. "{$PasswdAttr}"%0a->%25pmhlt%25[@{$RequestedPage}@] - page requested in URL, used on [[Site.PageNotFound]]. e.g. "{$RequestedPage}"%0a->%25pmhlt%25[@{$SiteGroup}@] - default interface group name for e.g. SideBar, forms, templates, as in "{$SiteGroup}"%0a->%25pmhlt%25[@{$SiteAdminGroup}@] - default administrative group name for e.g. AuthUser, Blocklist, as in "{$SiteAdminGroup}"%0a->%25pmhlt%25[@{$WikiTitle}@] - title of the website, as in "{$WikiTitle}"%0a->%25pmhlt%25[@{$Title}@] - page title (may differ from Name), as in "{$Title}"%0a->%25pmhlt%25[@{$Titlespaced}@] - either the page title (if defined), or the spaced page name, as in "{$Titlespaced}"%0a->%25pmhlt%25 [@{$GroupHomePage}@], [@{$GroupHomePageName}@], [@{$GroupHomePageTitle}@], [@{$GroupHomePageTitlespaced}@] - information about the homepage in the group of the current page, respectively the full name of the homepage, its [@{$Name}@], [@{$Title}@], and [@{$Titlespaced}@], as in "{$GroupHomePage}", "{$GroupHomePageName}", "{$GroupHomePageTitle}", "{$GroupHomePageTitlespaced}"%0a->%25pmhlt%25 All other variables derived from the group homepage can be output with nested markup, for example \%0a [@{{$GroupHomePage}$LastModified}@], [@{{$GroupHomePage}$Description}@].%0a%0aIn addition to the above, there are some page-invariant variables available through this markup:%0a%0a->%25pmhlt%25[@{$Author}@] - the name of the person currently interacting with the site, as in "{$Author}"%0a->%25pmhlt%25[@{$AuthId}@] - current authenticated id, as in "{$AuthId}" %25red%25note the lower case 'd'.%25%25%0a%0a->%25pmhlt%25[@{$Version}@] - PmWiki version, as in "{$Version}"%0a->%25pmhlt%25[@{$VersionNum}@] - The internal version number, as in "{$VersionNum}"%0a->%25pmhlt%25[@{$ScriptUrl}@] - The URL to the pmwiki script, as in "{$ScriptUrl}"%0a%0a%0a[[#specialreferences]]%0a!! Special references%0aSpecial referenced variables are used to specify the context of the variable when:%0a* the variable is [[PmWiki/IncludeOtherPages|included]] into a destination (target) page%0a* the variable is used in a sidebar, header, or footer.%0a%0aPrefixing the variable name with an asterisk (*) means the variable's value is related to the browsed page or main (body) page.%0a%0a* %25pmhlt%25[@{*$PageVariablename}@] - prefixed by an asterisk (*) - value reflects the context of the browsed page.\\%0a Without the asterisk the variable's value is provided by the page from which it originates, eg source page of include, sidebar, or header or footer.\\%0a With asterisk the value will be provided by the browsed page, even if the markup comes from an included page or from a sidebar.%0a* %25pmhlt%25[@{$PageVariablename}@] - retains value in source page context.%0a* %25pmhlt%25[@{=$PageVariablename}@] - used only in [[PageLists|pagelist]] templates to print the variable provided by each page from the pagelist.%0a%0a-%3c See also $EnableRelativePageVars.%0a-%3c Special references are also used in [[page text variables(#specialreferences)]] and [[page list templates(#specialreferences)]].%0a%0aFor example you can test to see if the page is part of another page%0a(:markup:)%0a(:if ! name {$FullName}:) %0a%25comment%25 name of this page is not the same as the page this text was sourced from%0a->[[{$FullName}#anchor | more ...]]%0a(:ifend:)%0a(:markupend:)%0aor refer to the main page in a sidebar, footer, or header%0a(:markup class=horiz:)%0aThis page is [[{*$FullName}]]%0a(:markupend:)%0a%0a[[#specialreferencesend]]%0a%0a[[#security]]%0a!! Page variable security ($authpage)%0a%0aThe form %25pmhlt%25[@{pagename$variable}@] in some [[PageLists]], can display the values for other pages, regardless of the password protections. %0a%0aIf the other pages are protected and the visitor has no read permissions, [[PageVariables]], unlike [[PageTextVariables]], normally display the values. While most variables do not contain sensitive information, some of them could do: $Title, $Description and those starting with $LastModified.%0a%0a%25pmhlt%25Administrators and module developers can redefine the sensitive page variables to respect authentications, by using the "$authpage" variable instead of "$page" in the definition. The following snippet can be added in @@local/config.php@@ -- it will rewrite the default possibly sensitive definitions to the secure ones.%0a%0a%25hlt php%25[@%0aforeach($FmtPV as $k=>$v) {%0a if(preg_match('/^\\$(Title(spaced)?|LastModified(By|Host|Summary|Time)?|Description)$/', $k))%0a $FmtPV[$k] = str_replace('$page', '$authpage', $v);%0a}%0a@]%0a%0a%0a[[#custompv]]%0a!! Custom page variables%0a%0aYou may add custom page variables as a local customization. In a local configuration file or a recipe script, use the variable $FmtPV:%0a%0a->%25hlt php%25[@%0a$FmtPV['$VarName'] = "'variable definition'";%0a$FmtPV['$CurrentSkin'] = '$GLOBALS["Skin"]';%0a@]%0a%0aDefines new Page Variable of name $CurrentSkin, which can be used in the page with [@{$CurrentSkin}@] (also for [[Conditional markup]]). It's necessary to use the single quotes nested inside double-quotes as shown above (preferred) or a double-quoted string nested inside single-quotes like ''[@'"this"'@]''.%0a%0aYou can make a string a Page Variable by adding the string to the $GLOBALS[] array first.%0a%0a->%25hlt php%25[@%0a## Create a {$BaseUrl} page variable%0a$GLOBALS['BaseUrl'] = $UrlScheme."://".$_SERVER["HTTP_HOST"]."/Wiki";%0a$FmtPV['$BaseUrl'] = '$GLOBALS["BaseUrl"]';%0a@]%0a%0aYou can also have a function create the string.%0a%0a->%25hlt php%25[@%0a## Create a {$BaseUrl} page variable%0afunction BaseUrl() { %0a global $UrlScheme;%0a return $UrlScheme."://".$_SERVER['HTTP_HOST']."/Wiki"; %0a}%0a$FmtPV['$BaseUrl'] = 'BaseUrl()';%0a@]%0a%0a>>frame%3c%3c%0aPlease note that the values of the elements of $FmtPV are @@eval()@@ed so '''always sanitize any user input'''. The following is very insecure[=:=]%0a%0a->%25hlt php%25[@$FmtPV['$Var'] = $_REQUEST['Var'];@] %25red%25# critically insecure, allows PHP code injection%25%25\\%0a%25hlt php%25[@$FmtPV['$Var'] = '"'. addslashes($_REQUEST['Var']).'"';@] %25red%25# critically insecure, allows PHP code injection%25%25%0a%0aSee the recipe [[Cookbook:HttpVariables]] for a better way to use these variables.%0a>>%3c%3c%0a%0a!! See also%0a%0a* [[Cookbook:More custom page variables]]%0a* [[PmWiki.Variables]] — about variables internal to PmWiki.%0a* [[PmWiki.MarkupMasterIndex]] — complete list of PmWiki markups.%0a* [[PmWiki/PageTextVariables]] — page variables automatically made available through natural page markup or explicit page markup within the wiki text of the page.%0a* [[PmWiki.Markup Expressions]] — markup expressions can process page variables.%0a%0a>>faq%3c%3c [[#faq]]%0a%0aQ:Is there a variable like $LastModified, but which shows me the creation time?%0aA:No, but you can create one in config.php. For instance:%0a-->%25hlt php%25[@# add page variable [={$PageCreationDate}=] in format yyyy-mm-dd@]%0a-->%25hlt php%25[@$FmtPV['$PageCreationDate'] = '[[PmWiki/Functions#PSFT|PSFT]]("[=%25Y-%25m-%25d=]", $page["ctime"])';@]%0a%0a->If you like the same format that you define in config.php with $TimeFmt use%0a-->%25hlt php%25[@$FmtPV['$Created'] = "[[PmWiki/Functions#PSFT|PSFT]](\$GLOBALS['TimeFmt'], \$page['ctime'])";@]%0a%0aQ: How can I test if a variable is set and/or not empty?%0aA: Use %25pmhlt%25[@[=(:if ! equal "{$Variable}" "":) $Variable is not empty. (:ifend:)=]@]. Note that undefined/inexistent variables appear as empty ones.%0a%0aCategories: [[!PmWiki Developer]] -time=1666586148 +rev=129 +targets=PmWiki.PageVariables,PmWiki.Variables,Cookbook.Functions,PmWiki.FmtPageName,PmWiki.BasicVariables,PmWiki.MarkupExpressions,Site.PageNotFound,PmWiki.IncludeOtherPages,PmWiki.PageLists,PmWiki.PageTextVariables,PmWiki.PageListTemplates,PmWiki.OtherVariables,PmWiki.ConditionalMarkup,Cookbook.HttpVariables,Cookbook.MoreCustomPageVariables,PmWiki.MarkupMasterIndex,PmWiki.Functions,Category.PmWikiDeveloper,!PmWikiDeveloper +text=(:title Page specific variables:)%0a(:description Documentation for "variables" that are associated with pages. :)%0a(:Summary: variables that are associated with pages:)%0a(:Audience: authors (intermediate) :)%0a%0a[[#desc]]This page describes the "[[variables]]" that are associated with pages. Page variables have the form %25pmhlt%25[@{$variable}@], and can be used in page markup or in certain formatting strings in PmWiki. For example, the markup "[@{$Group}@]" renders in this page as "{$Group}".%0a%0aNote: Do not confuse these variables (set and used only in PmWiki pages) with [[PmWiki/Variables|PHP variables]]. Page variables can be read in PHP with the [[Cookbook:Functions#PageVar|PageVar()]] function.%0a%0aNote that these variables do not necessarily exist in the PHP code, because they have to be determined for a specific page. (However, they are usable in [[FmtPageName]] strings.)%0a%0a%25pmhlt%25There is also the form [@{pagename$variable}@], which returns the value of the variable for another page. For example, "[@{MarkupMasterIndex$Title}@]" displays as "{MarkupMasterIndex$Title}".%0a%0a%0a!! Default page variables%0a%0aThe page variables defined for PmWiki are:%0a%0a->%25pmhlt%25[@{$Action}@] - page's url action argument, as in "{$Action}"%0a->%25pmhlt%25[@{$BaseName}@] - page's "base" form (stripping any prefixes or suffixes defined via @@$BaseNamePatterns@@) as in "`{$BaseName}"%0a->%25pmhlt%25[@{$DefaultGroup}@] - default group name, as in "{$DefaultGroup}"%0a->%25pmhlt%25[@{$DefaultName}@] - name of default page, as in "`{$DefaultName}" (take note also of $PagePathFmt for setting a homepage for a group)%0a->%25pmhlt%25[@{$Description}@] - page's description from the [@(:description:)@] markup, as in "{$Description}"%0a->%25pmhlt%25[@{$FullName}@] - page's full name, as in "`{$FullName}"%0a->%25pmhlt%25[@{$Group}@] - page's group name, as in "`{$Group}"%0a->%25pmhlt%25[@{$Groupspaced}@] - spaced group name, as in "{$Groupspaced}"%0a%0a->%25pmhlt%25[@{$LastModified}@] - date page was edited, as in "{$LastModified}"%0a->%25pmhlt%25[@{$LastModifiedBy}@] - page's last editor, as in "{$LastModifiedBy}"%0a->%25pmhlt%25[@{$LastModifiedHost}@] - IP of page's last editor, as in "{$LastModifiedHost}"%0a->%25pmhlt%25[@{$LastModifiedSummary}@] - Summary from last edit, as in "{$LastModifiedSummary}"%0a->%25pmhlt%25[@{$LastModifiedTime}@] - time page was edited in unix-style timestamp, as in "{$LastModifiedTime}"%0a-->%25pmhlt%25This can be used (preceded by '@') in [[PmWiki.MarkupExpressions#ftime|[@{(ftime)}@]]] and other date/time markups.%0a%0a->%25pmhlt%25[@{$Name}@] - page name, as in "`{$Name}"%0a->%25pmhlt%25[@{$Namespaced}@] - spaced page name, as in "{$Namespaced}"%0a->%25pmhlt%25[@{$PageUrl}@] - page's url, as in "{$PageUrl}"%0a->%25pmhlt%25[@{$PasswdRead}@] - "read" permissions for the page e.g. "{$PasswdRead}"%0a->%25pmhlt%25[@{$PasswdEdit}@] - "edit" permissions for the page e.g. "{$PasswdEdit}"%0a->%25pmhlt%25[@{$PasswdAttr}@] - "attr" permissions for the page e.g. "{$PasswdAttr}"%0a->%25pmhlt%25[@{$RequestedPage}@] - page requested in URL, used on [[Site.PageNotFound]]. e.g. "{$RequestedPage}"%0a->%25pmhlt%25[@{$SiteGroup}@] - default interface group name for e.g. SideBar, forms, templates, as in "{$SiteGroup}"%0a->%25pmhlt%25[@{$SiteAdminGroup}@] - default administrative group name for e.g. AuthUser, Blocklist, as in "{$SiteAdminGroup}"%0a->%25pmhlt%25[@{$WikiTitle}@] - title of the website, as in "{$WikiTitle}"%0a->%25pmhlt%25[@{$Title}@] - page title (may differ from Name), as in "{$Title}"%0a->%25pmhlt%25[@{$Titlespaced}@] - either the page title (if defined), or the spaced page name, as in "{$Titlespaced}"%0a->%25pmhlt%25 [@{$GroupHomePage}@], [@{$GroupHomePageName}@], [@{$GroupHomePageTitle}@], [@{$GroupHomePageTitlespaced}@], [@{$GroupHomePageUrl}@] - information about the homepage in the group of the current page, respectively the full name of the homepage, its [@{$Name}@], [@{$Title}@], [@{$Titlespaced}@], and [@{$PageUrl}@] as in "{$GroupHomePage}", "{$GroupHomePageName}", "{$GroupHomePageTitle}", "{$GroupHomePageTitlespaced}", "{$GroupHomePageUrl}"%0a->%25pmhlt%25 All other variables derived from the group homepage can be output with nested markup, for example \%0a [@{{$GroupHomePage}$LastModified}@], [@{{$GroupHomePage}$Description}@].%0a%0aIn addition to the above, there are some page-invariant variables available through this markup:%0a%0a->%25pmhlt%25[@{$Author}@] - the name of the person currently interacting with the site, as in "{$Author}"%0a->%25pmhlt%25[@{$AuthId}@] - current authenticated id, as in "{$AuthId}" %25red%25note the lower case 'd'.%25%25%0a%0a->%25pmhlt%25[@{$Version}@] - PmWiki version, as in "{$Version}"%0a->%25pmhlt%25[@{$VersionNum}@] - The internal version number, as in "{$VersionNum}"%0a->%25pmhlt%25[@{$ScriptUrl}@] - The URL to the pmwiki script, as in "{$ScriptUrl}"%0a%0a%0a[[#specialreferences]]%0a!! Special references%0aSpecial referenced variables are used to specify the context of the variable when:%0a* the variable is [[PmWiki/IncludeOtherPages|included]] into a destination (target) page%0a* the variable is used in a sidebar, header, or footer.%0a%0aPrefixing the variable name with an asterisk (*) means the variable's value is related to the browsed page or main (body) page.%0a%0a* %25pmhlt%25[@{*$PageVariablename}@] - prefixed by an asterisk (*) - value reflects the context of the browsed page.\\%0a Without the asterisk the variable's value is provided by the page from which it originates, eg source page of include, sidebar, or header or footer.\\%0a With asterisk the value will be provided by the browsed page, even if the markup comes from an included page or from a sidebar.%0a* %25pmhlt%25[@{$PageVariablename}@] - retains value in source page context.%0a* %25pmhlt%25[@{=$PageVariablename}@] - used only in [[PageLists|pagelist]] templates to print the variable provided by each page from the pagelist.%0a%0a-%3c See also $EnableRelativePageVars.%0a-%3c Special references are also used in [[page text variables(#specialreferences)]] and [[page list templates(#specialreferences)]].%0a%0aFor example you can test to see if the page is part of another page%0a(:markup:)%0a(:if ! name {$FullName}:) %0a%25comment%25 name of this page is not the same as the page this text was sourced from%0a->[[{$FullName}#anchor | more ...]]%0a(:ifend:)%0a(:markupend:)%0aor refer to the main page in a sidebar, footer, or header%0a(:markup class=horiz:)%0aThis page is [[{*$FullName}]]%0a(:markupend:)%0a%0a[[#specialreferencesend]]%0a%0a[[#security]]%0a!! Page variable security ($authpage)%0a%0aThe form %25pmhlt%25[@{pagename$variable}@] in some [[PageLists]], can display the values for other pages, regardless of the password protections. %0a%0aIf the other pages are protected and the visitor has no read permissions, [[PageVariables]], unlike [[PageTextVariables]], normally display the values. While most variables do not contain sensitive information, some of them could do: $Title, $Description and those starting with $LastModified.%0a%0a%25pmhlt%25Administrators and module developers can redefine the sensitive page variables to respect authentications, by using the "$authpage" variable instead of "$page" in the definition. The following snippet can be added in @@local/config.php@@ -- it will rewrite the default possibly sensitive definitions to the secure ones.%0a%0a%25hlt php%25[@%0aforeach($FmtPV as $k=>$v) {%0a if(preg_match('/^\\$(Title(spaced)?|LastModified(By|Host|Summary|Time)?|Description)$/', $k))%0a $FmtPV[$k] = str_replace('$page', '$authpage', $v);%0a}%0a@]%0a%0a%0a[[#custompv]]%0a!! Custom page variables%0a%0aYou may add custom page variables as a local customization. In a local configuration file or a recipe script, use the variable $FmtPV:%0a%0a->%25hlt php%25[@%0a$FmtPV['$VarName'] = "'variable definition'";%0a$FmtPV['$CurrentSkin'] = '$GLOBALS["Skin"]';%0a@]%0a%0aDefines new Page Variable of name $CurrentSkin, which can be used in the page with [@{$CurrentSkin}@] (also for [[Conditional markup]]). It's necessary to use the single quotes nested inside double-quotes as shown above (preferred) or a double-quoted string nested inside single-quotes like ''[@'"this"'@]''.%0a%0aYou can make a string a Page Variable by adding the string to the $GLOBALS[] array first.%0a%0a->%25hlt php%25[@%0a## Create a {$BaseUrl} page variable%0a$GLOBALS['BaseUrl'] = $UrlScheme."://".$_SERVER["HTTP_HOST"]."/Wiki";%0a$FmtPV['$BaseUrl'] = '$GLOBALS["BaseUrl"]';%0a@]%0a%0aYou can also have a function create the string.%0a%0a->%25hlt php%25[@%0a## Create a {$BaseUrl} page variable%0afunction BaseUrl() { %0a global $UrlScheme;%0a return $UrlScheme."://".$_SERVER['HTTP_HOST']."/Wiki"; %0a}%0a$FmtPV['$BaseUrl'] = 'BaseUrl()';%0a@]%0a%0a>>frame%3c%3c%0aPlease note that the values of the elements of $FmtPV are @@eval()@@ed so '''always sanitize any user input'''. The following is very insecure[=:=]%0a%0a->%25hlt php%25[@$FmtPV['$Var'] = $_REQUEST['Var'];@] %25red%25# critically insecure, allows PHP code injection%25%25\\%0a%25hlt php%25[@$FmtPV['$Var'] = '"'. addslashes($_REQUEST['Var']).'"';@] %25red%25# critically insecure, allows PHP code injection%25%25%0a%0aSee the recipe [[Cookbook:HttpVariables]] for a better way to use these variables.%0a>>%3c%3c%0a%0a!! See also%0a%0a* [[Cookbook:More custom page variables]]%0a* [[PmWiki.Variables]] — about variables internal to PmWiki.%0a* [[PmWiki.MarkupMasterIndex]] — complete list of PmWiki markups.%0a* [[PmWiki/PageTextVariables]] — page variables automatically made available through natural page markup or explicit page markup within the wiki text of the page.%0a* [[PmWiki.Markup Expressions]] — markup expressions can process page variables.%0a%0a>>faq%3c%3c [[#faq]]%0a%0aQ:Is there a variable like $LastModified, but which shows me the creation time?%0aA:No, but you can create one in config.php. For instance:%0a-->%25hlt php%25[@# add page variable [={$PageCreationDate}=] in format yyyy-mm-dd@]%0a-->%25hlt php%25[@$FmtPV['$PageCreationDate'] = 'PSFT("[=%25Y-%25m-%25d=]", $page["ctime"])';@]%0a%0a->If you like the same format that you define in config.php with $TimeFmt use%0a-->%25hlt php%25[@$FmtPV['$Created'] = 'PSFT($GLOBALS["TimeFmt"], $page["ctime"])';@]%0a%0aA: Previously, PmWiki didn't store a "ctime" page attribute. Some core pages, and old wiki pages, may not have this information. See also the function [[Functions#PSFT|PSFT()]].%0a%0aQ: How can I test if a variable is set and/or not empty?%0aA: Use %25pmhlt%25[@(:if ! equal "{$Variable}" "":) $Variable is not empty. (:ifend:)@]. Note that undefined/inexistent variables appear as empty ones.%0a%0aCategories: [[!PmWiki Developer]] +time=1724056183 title=Page specific variables diff --git a/wikilib.d/PmWiki.PagelistVariables b/wikilib.d/PmWiki.PagelistVariables index 39529d69..bb47759a 100644 --- a/wikilib.d/PmWiki.PagelistVariables +++ b/wikilib.d/PmWiki.PagelistVariables @@ -1,10 +1,10 @@ -version=pmwiki-2.3.25 ordered=1 urlencoded=1 +version=pmwiki-2.3.36 ordered=1 urlencoded=1 author=Petko charset=UTF-8 -csum=$EnableSearchAtLeastOneTerm (+433) +csum=Clarify $EnablePageListProtect may or may not be faster, %25hlt php%25 (+348) ctime=1136054369 name=PmWiki.PagelistVariables -rev=45 +rev=47 targets=PmWiki.PagelistVariables,PmWiki.CustomPagelistSortOrder,PmWiki.PageLists,Cookbook.SearchPatterns,PmWiki.PathVariables,Site.LocalTemplates,Site.PageListTemplates,PmWiki.IncludeOtherPages,PmWiki.PageListTemplates,Site.Search -text=(:Summary:variables used with [[PmWiki/page lists]] and search results:)%0a:$EnablePageListProtect:When set to 1 (which is the default), causes [@(:pagelist:)@] and [@(:searchresults:)@] to exclude listing any pages for which the browser does not currently have read authorization. Setting this to zero means that read-protected pages can appear in a listing, but can also speed up searches considerably (because page permissions do not need to be checked).%0a%0a:$PageListSortCmpFunction:The function used to compare values when ordering a page list, for historical reasons the default is '[[(http://php.net/)strcasecmp]]' and sorts alphabetically and case insensitively. If you regularly order numbers or strings with numbers, you can set this variable to '[[(http://php.net/)strnatcasecmp]]' and the list will be sorted according to a [[https://github.com/sourcefrog/natsort#readme|natural order]], case insensitively:\\%0a[@ $PageListSortCmpFunction = 'strnatcasecmp';# "natural" sorting of pagelists@]\\%0aOr you can write here the name of a custom function you have defined. This is the general sorting function, for specific needs you can create specific functions, see [[(PmWiki:)CustomPagelistSortOrder]].%0a%0a:$PageListVarFoldFn: PageList and Search terms, including page variable search terms are always case insensitive for the Latin alphabet. For international characters the page variable terms were case sensitive until PmWiki 2.2.115, and became case insensitive from 2.2.116 (like for the Latin characters). If your pagelists relied on the previous behavior, you can set here a function name that does not change the case of the international characters, for example [@$PageListVarFoldFn = 'strval';@]%0a%0a:$SearchPatterns:An array of page name patterns to be required or excluded from search and [[PmWiki/PageLists|pagelist]] results. In order to be included in a search listing or page listing, a page's name must not match any pattern that is delimited by exclamation points (!) and must match all other patterns. See [[Cookbook:SearchPatterns]].%0a--> [@# Limit all searches to Main group%0a$SearchPatterns['default'][] = '/^Main\\./';%0a# Exclude the Main group from search results%0a$SearchPatterns['default'][] = '!^Main\\.!';%0a# Exclude RecentChanges pages from search results%0a$SearchPatterns['default'][] = '!\\.(All)?RecentChanges$!';%0a# Prevent a page from listing itself in (:pagelist:) or (:searchresults:)%0a$SearchPatterns['default'][] = FmtPageName('!^$FullName$!', $pagename);%0a@]%0a%0a:$SearchBoxOpt:%0a--> For example [@ $SearchBoxOpt ['target'] = '$DefaultGroup.Search'; @]%0a%0a:$SearchBoxInputType:The HTML "type" attribute for the search field. Default is "text" which is valid HTML4. If your skin uses HTML5, you can change this to "search":%0a--> @@ $SearchBoxInputType = "search";@@%0a%0a%0a:$EnablePageIndex:When set to 0, disables default indexing. By default PmWiki maintains a "link and word index" in $PageIndexFile which significantly speeds up categories, backlinks, and searches.%0a%0a:$PageIndexFile:The location of the "page index" file for [@(:pagelist:)@], defaults to @@$WorkDir/.pageindex@@.%0a%0a:$PageListCacheDir:The name of a writable directory where PmWiki can cache results of [@(:pagelist:)@] directives to speed up subsequent displays of the same list. Default is empty, which disables the pagelist cache.%0a--> [@# Enable pagelist caching in work.d/.pagelistcache%0a$PageListCacheDir = 'work.d/.pagelistcache';%0a@]%0a%0a:$PageSearchForm:The page to be used to format search results for [@?action=search@] (unless the current page has a "searchresults" directive in it). This variable can be an array, in which case the first page found from the array is used.%0a--> [@# Simple use of page search form in the default group%0a$PageSearchForm = '$DefaultGroup.Search';%0a@]%0a--> [@# Use Search page in current group if it exists, otherwise use Site.Search%0a$PageSearchForm = array('$Group.Search', '[=$[$SiteGroup/Search]=]');%0a@]%0a%0a:$FPLTemplatePageFmt:The pages to be searched for a pagelist template specified by a [@fmt=#xyz@] parameter. Defaults to searching the current page, [[Site.LocalTemplates]] and [[Site.PageListTemplates]].%0a%0a--> [@# PMWiki default setup%0aglobal $FPLTemplatePageFmt;%0a$FPLTemplatePageFmt = array(%0a '{$FullName}', %0a '{$SiteGroup}.LocalTemplates', %0a '{$SiteGroup}.PageListTemplates');@]%0a%0a-> It can be customized to look in other pages.%0a%0a--> [@# Search a Group.Templates page as well as the Site templates%0aglobal $FPLTemplatePageFmt;%0a$FPLTemplatePageFmt = array(%0a '{$Group}.Templates',%0a '{$SiteGroup}.LocalTemplates',%0a '{$SiteGroup}.PageListTemplates');@]%0a%0a-> Or declare defaults for the template array:%0a--> [@# Search a Group.Templates page as well as the Site templates%0aglobal $FPLTemplatePageFmt;%0aSDV($FPLTemplatePageFmt, array('{$FullName}',%0a '{$Group}.Templates',%0a '{$SiteGroup}.LocalTemplates', '{$SiteGroup}.PageListTemplates')%0a );@]%0a%0a:$EnableUndefinedTemplateVars: This variable controls how undefined [={$$Variable}=] is processed in [[IncludeOtherPages|includes]] and [[PageList templates]]. If set to 0 (default), undefined [={$$Variable}=]s are removed from the included section or template. If set to 1, undefined [={$$Variable}=]s are displayed as is, with {$$...}. ''Note that PmWiki versions 2.2.13 and earlier '''kept''' unset include/template variables.''%0a: : @@$EnableUndefinedTemplateVars = 0;@@ # Delete unset raw template variables%0a: : @@$EnableUndefinedTemplateVars = 1;@@ # Keep and print unset raw template variables%0a%0a:$PageIndexFoldFunction: A custom function used to 'fold' (simplify, normalize) the page words before storing them in the wiki.d/.pageindex file, and the search terms typed by the users. By default, PmWiki converts these to lowercase, here you can define a function that does it differently (for example, stripping inline HTML tags).%0a%0a:$PageIndexTermsFunction: A function to split the page texts into normalized search terms. By default, the core function PageIndexTerms() is called, with this variable you can override it with a custom function. This may be useful if you need to remove some texts from the page index, for example inline HTML tags. The first and only argument of the function may be either a string, or an array of strings.%0a%0a:$EnableSearchAtLeastOneTerm:By default, searching for several terms like @@term1 term2@@ will list pages containing all the terms. Setting this variable to 1 will cause the search to list pages containing at least one of the typed terms. In this case, required terms can be preceded by "+" like @@+term1 +term2@@. If you change this variable, you may want to update the search instructions in your [[$[{$SiteGroup}/Search]]] page.%0a -time=1695897026 +text=(:Summary:Variables used with [[PmWiki/page lists]] and search results:)%0a:$EnablePageListProtect:When set to 1 (which is the default), causes %25pmhlt%25[@(:pagelist:)@] and [@(:searchresults:)@]%25%25 to exclude listing any pages for which the browser does not currently have read authorization. Setting this to zero means that read-protected pages can appear in a listing, even if the visitor cannot open them. In some cases this can speed up searches considerably (because page permissions do not need to be checked). OTOH in case of WikiGroups with different GroupAttributes permissions and many pages each, leaving the default enabled may be faster, as then the individual pages from unauthorized groups are not checked.%0a%0a:$PageListSortCmpFunction:The function used to compare values when ordering a page list, for historical reasons the default is '[[(http://php.net/)strcasecmp]]' and sorts alphabetically and case insensitively. If you regularly order numbers or strings with numbers, you can set this variable to '[[(http://php.net/)strnatcasecmp]]' and the list will be sorted according to a [[https://github.com/sourcefrog/natsort#readme|natural order]], case insensitively:\\%0a%25hlt php%25[@$PageListSortCmpFunction = 'strnatcasecmp';# "natural" sorting of pagelists@]%25%25\\%0aOr you can write here the name of a custom function you have defined. This is the general sorting function, for specific needs you can create specific functions, see [[(PmWiki:)CustomPagelistSortOrder]].%0a%0a:$PageListVarFoldFn: PageList and Search terms, including page variable search terms are always case insensitive for the Latin alphabet. For international characters the page variable terms were case sensitive until PmWiki 2.2.115, and became case insensitive from 2.2.116 (like for the Latin characters). If your pagelists relied on the previous behavior, you can set here a function name that does not change the case of the international characters, for example %25hlt php%25[@$PageListVarFoldFn = 'strval';@]%0a%0a:$SearchPatterns:An array of page name patterns to be required or excluded from search and [[PmWiki/PageLists|pagelist]] results. In order to be included in a search listing or page listing, a page's name must not match any pattern that is delimited by exclamation points (!) and must match all other patterns. See [[Cookbook:SearchPatterns]].%0a-> %25hlt php%25[@# Limit all searches to Main group%0a$SearchPatterns['default'][] = '/^Main\\./';%0a# Exclude the Main group from search results%0a$SearchPatterns['default'][] = '!^Main\\.!';%0a# Exclude RecentChanges pages from search results%0a$SearchPatterns['default'][] = '!\\.(All)?RecentChanges$!';%0a# Prevent a page from listing itself in (:pagelist:) or (:searchresults:)%0a$SearchPatterns['default'][] = FmtPageName('!^$FullName$!', $pagename);%0a@]%0a%0a:$SearchBoxOpt:%0a-> For example %25hlt php%25[@ $SearchBoxOpt['target'] = '$DefaultGroup.Search'; @]%0a%0a:$SearchBoxInputType:The HTML "type" attribute for the search field. Default is "text" which is valid HTML4. If your skin uses HTML5, you can change this to "search":%0a-> %25hlt php%25@@ $SearchBoxInputType = "search";@@%0a%0a%0a:$EnablePageIndex:When set to 0, disables default indexing. By default PmWiki maintains a "link and word index" in $PageIndexFile which significantly speeds up categories, backlinks, and searches.%0a%0a:$PageIndexFile:The location of the "page index" file for [@(:pagelist:)@], defaults to @@$WorkDir/.pageindex@@.%0a%0a:$PageListCacheDir:The name of a writable directory where PmWiki can cache results of [@(:pagelist:)@] directives to speed up subsequent displays of the same list. Default is empty, which disables the pagelist cache.%0a-> %25hlt php%25[@# Enable pagelist caching in work.d/.pagelistcache%0a$PageListCacheDir = 'work.d/.pagelistcache';%0a@]%0a%0a:$PageSearchForm:The page to be used to format search results for [@?action=search@] (unless the current page has a "searchresults" directive in it). This variable can be an array, in which case the first page found from the array is used.%0a-> %25hlt php%25[@# Simple use of page search form in the default group%0a$PageSearchForm = '$DefaultGroup.Search';%0a@]%0a-> %25hlt php%25[@# Use Search page in current group if it exists, otherwise use Site.Search%0a$PageSearchForm = array('$Group.Search', '[=$[$SiteGroup/Search]=]');%0a@]%0a%0a:$FPLTemplatePageFmt:The pages to be searched for a pagelist template specified by a [@fmt=#xyz@] parameter. Defaults to searching the current page, [[Site.LocalTemplates]] and [[Site.PageListTemplates]].%0a%0a-> %25hlt php%25[@# PMWiki default setup%0aglobal $FPLTemplatePageFmt;%0a$FPLTemplatePageFmt = array(%0a '{$FullName}', %0a '{$SiteGroup}.LocalTemplates', %0a '{$SiteGroup}.PageListTemplates');@]%0a%0a-> It can be customized to look in other pages.%0a%0a-> %25hlt php%25[@# Search a Group.Templates page as well as the Site templates%0aglobal $FPLTemplatePageFmt;%0a$FPLTemplatePageFmt = array(%0a '{$Group}.Templates',%0a '{$SiteGroup}.LocalTemplates',%0a '{$SiteGroup}.PageListTemplates');@]%0a%0a-> Or declare defaults for the template array:%0a-> %25hlt php%25[@# Search a Group.Templates page as well as the Site templates%0aglobal $FPLTemplatePageFmt;%0aSDV($FPLTemplatePageFmt, array('{$FullName}',%0a '{$Group}.Templates',%0a '{$SiteGroup}.LocalTemplates', '{$SiteGroup}.PageListTemplates')%0a);@]%0a%0a:$EnableUndefinedTemplateVars: This variable controls how undefined [={$$Variable}=] is processed in [[IncludeOtherPages|includes]] and [[PageList templates]]. If set to 0 (default), undefined [={$$Variable}=]s are removed from the included section or template. If set to 1, undefined [={$$Variable}=]s are displayed as is, with {$$...}. ''Note that PmWiki versions 2.2.13 and earlier '''kept''' unset include/template variables.''%0a: : %25hlt php%25@@$EnableUndefinedTemplateVars = 0;@@ # Delete unset raw template variables%0a: : %25hlt php%25@@$EnableUndefinedTemplateVars = 1;@@ # Keep and print unset raw template variables%0a%0a:$PageIndexFoldFunction: A custom function used to 'fold' (simplify, normalize) the page words before storing them in the wiki.d/.pageindex file, and the search terms typed by the users. By default, PmWiki converts these to lowercase, here you can define a function that does it differently (for example, stripping inline HTML tags).%0a%0a:$PageIndexTermsFunction: A function to split the page texts into normalized search terms. By default, the core function PageIndexTerms() is called, with this variable you can override it with a custom function. This may be useful if you need to remove some texts from the page index, for example inline HTML tags. The first and only argument of the function may be either a string, or an array of strings.%0a%0a:$EnableSearchAtLeastOneTerm:By default, searching for several terms like @@term1 term2@@ will list pages containing all the terms. Setting this variable to 1 will cause the search to list pages containing at least one of the typed terms. In this case, required terms can be preceded by "+" like @@+term1 +term2@@. If you change this variable, you may want to update the search instructions in your [[$[{$SiteGroup}/Search]]] page.%0a +time=1724058754 diff --git a/wikilib.d/PmWiki.ReleaseNotes b/wikilib.d/PmWiki.ReleaseNotes index 5537b2ff..2a515c14 100644 --- a/wikilib.d/PmWiki.ReleaseNotes +++ b/wikilib.d/PmWiki.ReleaseNotes @@ -1,10 +1,10 @@ -version=pmwiki-2.3.35 ordered=1 urlencoded=1 +version=pmwiki-2.3.36 ordered=1 urlencoded=1 author=Petko charset=UTF-8 -csum=2.3.36 (+475) +csum=2.3.37 (+1024) name=PmWiki.ReleaseNotes -rev=837 -targets=PmWiki.Upgrades,PmWiki.ChangeLog,PmWiki.Download,PmWiki.RoadMap,PmWiki.UploadVariables,PmWiki.EditVariables,PmWiki.UploadsAdmin,PmWiki.ConditionalMarkup,PmWiki.LayoutVariables,Cookbook.DarkColorScheme,PmWiki.LinkVariables,PmWiki.OtherVariables,PmWiki.Notify,PmWiki.UrlApprovals,PmWiki.Functions,PmWiki.SecurityVariables,PmWiki.Forms,Cookbook.PmForm,PmWiki.PageLists,PmWiki.Tables,PmWiki.TableOfContents,PmWiki.BasicVariables,PmWiki.AuthUser,Cookbook.PmSyntax,PmWiki.WikiStyles,PmWiki.PageVariables,Cookbook.MarkupDirectiveFunctions,PmWiki.PagelistVariables,Cookbook.CustomSyntax,Cookbook.LocalTimes,Cookbook.RecentUploadsLog,Cookbook.DiffDelay,Cookbook.ReindexCategories,Cookbook.PageListMultiTargets,PITS.01095,PITS.01461,Cookbook.RecipeCheck,Skins.SkinChange,Cookbook.ToggleNext,PmWiki.Links,Cookbook.SectionEdit,PmWiki.BlockMarkup,Cookbook.DeObMail,Cookbook.FixURL,Cookbook.NotSavedWarning,Cookbook.EditHelp,Cookbook.AutoTOC,Cookbook.DeltaBytesRecentChanges,Cookbook.RowspanInSimpleTables,Cookbook.LocalCSS,Cookbook.PreviewChanges,PmWiki.MarkupExpressions,PmWiki.DebugVariables,PmWiki.WikiTrails,SiteAdmin.AuthList,PmWiki.PathVariables,Site.UploadQuickReference,PmWiki.Troubleshooting,PmWiki.CustomMarkup,PmWiki.PageDirectives,PmWiki.I18nVariables,PmWiki.PageHistory,PmWiki.Uploads,PmWiki.Passwords,PmWiki.SiteAnalyzer,Site.Site,SiteAdmin.SiteAdmin,PITS.00961,Site.PageActions,Site.EditForm,Site.PageNotFound,PmWiki.Drafts,PmWiki.Blocklist,Cookbook.Cookbook,Cookbook.DebuggingForCookbookAuthors,PmWiki.SkinTemplates,PmWiki.ReleaseNotesArchive -text=(:title Release Notes:)(:Summary: Notes about new versions, important for upgrades:)%0aSee also: [[Upgrades]], [[Change log]], [[(PmWiki:)Download]] and [[(PmWiki:)Road map]].%0a(:comment The {*$:Released} variable is used in [[News/]]. :)%0a%0a!! Version 2.3.36 {*$:Released} (2024-08-07) [[#v2336]]%0a%0aThis version introduces a drag-and-drop feature for uploads, which can be enabled using $EnableUploadDrop. The new $TROEPatterns array allows configuration of replace-on-edit patterns when a template is loaded onto an empty page. When a page is deleted, a history entry will now be recorded, capturing the date and time, user, and change summary.%0a%0aThe release also includes a fix for PHP 8 and updated documentation.%0a%0a!! Version 2.3.35 {*$:Released} (2024-07-07) [[#v2335]]%0a%0aThis version updates links in the default sidebar to the HTTPS scheme, and places the links to PITS (issue tracking) and Mailing lists in a conditional for editors only.%0a%0aMinor improvements to PmSynxtax. It is now possible to show the source text of a wiki page highlighted by opening @@Page?action=source&highlight=1@@.%0a%0aA minor bug with escaped strings in page titles was fixed, and the documentation was updated.%0a%0aVersion 2.3.35 for security reasons removes the upload types "svg", "svgz", "htm", "html", "css", "swf", "fla", "epub". In some cases, those file formats may allow scripting and potentially open XSS vulnerabilities. Existing uploads with these extensions will not be affected. Wiki administrators who only allow trusted users to upload, can re-enable the extensions that they require with the following lines in config.php:%0a%0a%25hlt php%25[@%0a# NOTE: Only enable extensions that you require%0a%0a# files with no extension, the type may be auto-detected by the server%0a$UploadExts[''] = 'text/plain';%0a%0a# SVG images may contain scripting%0a$UploadExts['svg'] = 'image/svg+xml';%0a$UploadExts['svgz'] = 'image/svg+xml';%0a%0a# Epub may contain scripting and be opened by a browser extension%0a$UploadExts['epub'] = 'application/epub+zip';%0a%0a# Flash files may contain scripting on older browsers%0a# but are no longer supported by recent browsers%0a$UploadExts['swf'] = 'application/x-shockwave-flash';%0a$UploadExts['fla'] = 'application/vnd.adobe.fla';%0a%0a# HTML may contain scripting%0a$UploadExts['html'] = $UploadExts['htm'] = 'text/html';%0a%0a# CSS, if loaded by a browser, may request external resources%0a# and thus reveal your visitors to external websites%0a$UploadExts['css'] = 'text/css';%0a@]%0a%0aAdditionally, a few more upload extensions are considered for deprecation and removal from the core in early 2025. Please join the discussion: %0a https://www.pmwiki.org/wiki/PITS/01509.%0a%0a%0a!! Version 2.3.34 {*$:Released} (2024-05-27) [[#v2334]]%0a%0aThis version adds a new [[conditional markup]] for the current wiki action like %25pmhlt%25[@(:if action browse,edit:)@] which accepts comma-separated actions and wildcards. A new [[UploadsAdmin|upload extension]] "m4a" for audio files was added. A few updates for recent PHP versions, minor improvements for RecipeCheck and $GUIButtons, some cleanup and the documentation was updated.%0a%0a%0a!! Version 2.3.33 {*$:Released} (2024-04-21) [[#v2333]]%0a%0aThis version includes updates for PHP 8, improvements to the responsive skin, to the preview changes mode, to conditional markup handling, and the documentation was updated. PmSyntax will now colorize links in double brackets. A new variable $HTMLTitleFmt in local configuration can override the format between %25hlt html%25[@%3ctitle>...%3c/title>@] defined in a skin template.%0a%0a%0a!! Version 2.3.32 {*$:Released} (2024-03-24) [[#v2332]]%0a%0aThis version includes improvements for the dark color scheme, restoring a light scheme for printing.%0a%0aPictures with a white background may appear too bright on a dark theme, so a new variable $ImgDarkSuffix, when defined, allows you to prepare a separate picture adapted for the dark theme. On a wiki page you still use @@[=Attach:picture.png=]@@ and when the dark theme is loaded, the browser will load @@[=Attach:=]picture'''-dark'''.png@@ (if it exists).%0a%0aNew image and upload extensions AVIF and AVIFS were added, FileSizeCompact() was refactored to allow decimal file sizes, Recent changes pages will be locked to prevent blanking in case of concurrent uploads, and the documentation was updated.%0a%0a%0a!! Version 2.3.31 {*$:Released} (2024-02-23) [[#v2331]]%0a%0aThis release includes improvements to the color sets of the dark theme for the PmWiki-responsive skin, and for the PmSyntax highlighting. The dark toggle icons are now 3-state, rotating between Light, Dark, and Auto (browser/system preference), and an annotation tooltip near the icon displays the current mode. The dark theme functions detecting, storing, and restoring visitor preferences can be reused by other skins, and a new variable $EnableDarkThemeToggle can define the default theme for visitors that have not used the toggle icon.%0a%0aThe page attributes form where passwords and permissions are defined, can now add or remove passwords, users, or groups, without the need to rewrite the full definition. If for example you need to add a new password and a group without removing existing permissions, type "[@+ @]" (plus, space) or "[@- @]" (minus, space), followed by the permissions to be added or removed:%0a + MyNewPassword @newgroup%0a%0aEdit templates entries can now include page patterns where the template should be used. For example:%0a $EditTemplatesFmt[] = "Site.TalkTemplate name=*-Talk";%0a%0aThe function PrintFmt() was refactored to process markup and wiki pages before outputting HTML headers, which would allow for markup, headers, footers, sidebars included from the skin, and action pages like the Auth form, to configure $HTMLHeaderFmt and $HTMLStylesFmt, and the directives %25pmhlt%25@@[=(:noheader:), (:notitle:), (:noleft:), (:noaction:)=]@@%25%25 to work from these pages. In case your wiki relied on the previous behavior, you can revert to it by adding to config.php:%0a $EnablePrePrintFmt = 0;%0a%0aThe variable $EnableUploadVersions can now be set to 2, and if a file with the same name already exists, the new file will have a unique suffix added. %0a%0aRecipeCheck was updated to also list skins and report their versions.%0a%0aOther minor changes include: the "form" attribute was added to input fields; WikiStyles accept a new property 'columns', %25pmhlt%25@@[=(:redirect quiet=1:)=]@@%25%25 has been refactored to prevent an infinite loop, and the documentation was updated.%0a%0a%0a!! Version 2.3.30 {*$:Released} (2024-01-22) [[#v2330]]%0a%0aPublishing my 176th PmWiki release, this milestone coincides with 15.0 years of me (Petko) serving as core developer. Here are some new developments that may be interesting.%0a%0a'''Dark color theme''': The PmWiki-responsive skin has new styles for a user-activated dark/night scheme, with dark backgrounds and light texts. A dark theme can be softer on the eyes if used at night or in dark rooms. %0a%0aAn icon to toggle the styles is placed near the search box in the header. It is possible to place toggle icons and/or labels in wiki pages, headers, footers, sidebars, to toggle stylesheets, and all functions can be easily reused in other skins, and with syntax highlighting, see Cookbook:DarkColorScheme.%0a%0a'''PmSyntax''': We added styles for the new dark color theme. These may be improved in the future.%0a%0a'''PmWiki logo''': A new logo in SVG format was added to pub/skins/pmwiki, and the variable $PageLogoUrl was updated to use the new logo by default. A vector logo can upscale without pixelizing or blurring and looks better on the dark theme. Most wikis have their own logos, this will not change, but if you prefer to display the old raster logo, add to config.php such lines:%0a%0a%25hlt php%25[@%0a$FarmPubDirUrl = $PubDirUrl; # if not already defined%0a$PageLogoUrl = "$FarmPubDirUrl/skins/pmwiki/pmwiki-32.gif"%0a@]%0a%0a'''Page history''': A significant improvement in the word-diff highlighting precision.%0a%0a'''Uploads''': Various fixes for $EnableUploadMimeMatch and Attach: links with escaped filenames.%0a%0a'''Forms''': The input field %25pmhlt%25[@(:input e_author:)@] is now available to all forms with pre-filled author name and "required" attribute per $EnablePostAuthorRequired. A positional form action URL no longer needs to be quoted.%0a%0a'''Quiet redirects''': With the directive %25pmhlt%25[@(:redirect OtherPage:)@], the variable $EnableRedirectQuiet can now be set to 2 to make all redirects quiet by default (without @@quiet=1@@ argument), unless there is a @@quiet=0@@ argument. Quiet redirects will now prevent multiple jumps and infinite loop errors (like normal redirects).%0a%0aThe release includes a few other minor fixes and the documentation was updated.%0a%0a!! Version 2.3.29 {*$:Released} (2023-12-18) [[#v2329]]%0a%0aThis version includes a fix for PHP 8.2 and improvements to the PmSyntax functions, markup directives defined in $MarkupDirectiveFunctions now accept dashes in attribute names, and the documentation was updated.%0a%0a%0a!! Version 2.3.28 {*$:Released} (2023-11-27) [[#v2328]]%0a%0aThis version adds new form input types "month" and "color".%0a%0aA new variable $NotifyRelatedTrailFmt allows for the Notify trail= function to automatically include related pages when the base page is in the trail. This has been enabled on PmWiki.org, so if your notify trail contains Cookbook.MyRecipe, you will be notified about edits to this page, but also to Cookbook.MyRecipe-Talk and Cookbook.MyRecipe-Users.%0a%0aThe "simpletable" zebra backgrounds are now reversed when the table has a %3cthead> element, in order to have dark-light-dark rows instead of dark-dark-light.%0a%0aWith [[UrlApprovals]], if a URL with the insecure http: scheme has been approved, URLs with the secure https: scheme to the same domain name will be automatically approved (not the other way around).%0a%0aSome utility JavaScript functions should now work better when localStorage is not available.%0a%0aThe documentation was updated.%0a%0a%0a!! Version 2.3.27 {*$:Released} (2023-10-23) [[#v2327]]%0a%0aThis version includes fixes for PHP 8, and for time formats with an invalid timezone. %0a%0aWhen merging the last edit without an edit summary, it will now reuse the previous edit summary.%0a%0aThe ".diffmarkup" element now has the style "white-space: pre-wrap" - if a custom skin disables core styles you may want to update the skin styles.%0a%0aWhen $EnableEditAutoText is enabled, new keyboard shortcuts will be available: %25pmhlt%25@@[=Ctrl+B ('''bold'''), Ctrl+I (''italic''), Ctrl+K ([[link]]/unlink).=]@@%0a%0aThe documentation was updated.%0a%0a%0a!! Version 2.3.26 {*$:Released} (2023-09-28) [[#v2326]]%0a%0aThis version includes updates for PHP 8.2, customizable HTML snippets for trails and input labels. It is now possible to configure searching for "at least one" term among many, as opposed to currently searching for all terms. Extensions are now removed from the $UploadExts array if their size is set to zero in $UploadExtSize, and the documentation was updated.%0a%0a%0a!! Version 2.3.25 {*$:Released} (2023-07-29) [[#v2325]]%0a%0aThis version includes updates for PHP 8.2. Some core markup directives were refactored to prevent very rare bugs. The documentation was updated.%0a%0a%0a!! Version 2.3.24 {*$:Released} (2023-06-06) [[#v2324]]%0a%0aThis version includes some code refactoring, and a new helper function [[Functions#InsertEditFunction|InsertEditFunction()]] to simplify the reuse of core functionality by recipes. %0a%0aIt is now possible to configure the merging of the latest edits by the same author into a single history entry, see $EnableMergeLastMinorEdit.%0a%0aNew configuration variables $AuthFormRespCode, $EnableUploadMimeMatch, $EnableDownloadRanges, see documentation.%0a%0aPmForm now can validate an email address field with the "template require FIELD if=validemail" condition.%0a%0aA few other minor improvements in the [[change log]], and the documentation was updated.%0a%0a%0a!! Version 2.3.23 {*$:Released} (2023-05-03) [[#v2323]]%0aThis version implements session tokens to prevent potential cross-site request forgery vulnerabilities, suggested by Dominique Faure. Most core actions that modify pages or files should have this enabled and should work like before. %0a%0aThis new feature can be disabled by setting these variables in config.php:%0a%0a%25hlt php%25[@%0a $EnablePmToken = 0; # edit, upload, attributes, approveurls%0a $PmFormEnablePmToken = 0; # PmForm%0a@]%0a%0aSome installations might encounter the error message "Token invalid or missing". These can include custom edit forms, automated scripts posting to the wiki, AJAX posting text or uploads used by some recipes, or partial upgrades where some core scripts haven't been updated. Most of these should be easy to update -- please check if you're using the latest recipe versions, otherwise report such cases to us -- otherwise you may selectively disable the feature. See [[Upgrades#pmtoken]].%0a%0aA [[Forms|form]] element %25pmhlt%25[@(:input pmtoken:)@] was added, and the helper function [[Functions#pmtoken|pmtoken()]] was documented to make it easy for custom forms and recipes to use this new feature.%0a%0aThe version also includes a minor code refactoring, a bug fix, and the documentation was updated.%0a%0a%0a!! Version 2.3.22 {*$:Released} (2023-04-06) [[#v2322]]%0aThis version adds to the core the Cookbook:PmForm recipe (script and templates), not enabled by default. This is in order to reduce my workload, and future updates to PmForm will be made only in the core version. %0a%0aIf you already use PmForm, you can enable the core script, by modifying your @@include_once()@@ call from "@@'''cookbook'''/pmform.php@@" to "@@'''scripts'''/pmform.php@@". Your existing templates and configuration should continue to work.%0a%0aA bug was fixed with [[PageLists]] with multiple @@category=+A,+B@@ categories. Input [[forms]] and buttons can now be configured to ask for confirmation before they are submitted. A few updates for recent PHP versions, and other minor improvements, and the documentation was updated.%0a%0a!! Version 2.3.21 {*$:Released} (2023-03-06) [[#v2321]]%0aThis version includes updates for PHP 8, and bug fixes with [[tables#sortable|sortable tables]] and multiline $MarkupDirectiveFunctions. The core [[table of contents]] was updated to work better with recent SectionEdit versions, and the documentation was updated.%0a%0aNew features include: the upload extension CSV, $EnableLocalTimes with a new short mode 3 where old dates are shown as MM'YY, and a new variable $EnableCopyCode to add [@[+]@] buttons for easy copying of preformatted blocks.%0a%0a!! Version 2.3.20 {*$:Released} (2023-02-12) [[#v2320]]%0aThis version fixes an unidentified variable warning introduced yesterday in 2.3.19.%0a%0a!! Version 2.3.19 {*$:Released} (2023-02-11) [[#v2319]]%0aThis version includes fixes for recent PHP versions, new helper functions, new variables allowing more customization, and the documentation was updated.%0a%0aWork is underway to define and implement a new family of self-contained recipes "Modules" which should be easier to install, configure and update. It may be possible to easily update your modules and skins either from a remote Git/SVN repository, or by simply dropping a ZIP file into the "modules" directory, and use a wiki-based editor to enable and configure them. Nothing will change for existing recipes, and they will not need to be updated; this will be an entirely optional new interface. Let me know if you can suggest features/scopes added to the wishlist.%0a%0aPmWiki too may be able to run directly from the read-only release ZIP archive, without the need to unzip it first. Again, this will be entirely optional, the current ways will continue to work as before, and slightly faster than the ZIP version (approx. 2%25 faster in my benchmarks).%0a%0a%0a!! Version 2.3.18 {*$:Released} (2023-01-15) [[#v2318]]%0a%0aThis version fixes a bug with user groups in with conditional markup, includes updates for PHP 8, minor improvements to the edit textarea and to the syntax highlighting. A helper function pm_json_encode() was added for servers where the PHP-JSON extension is not enabled.%0a%0aThe documentation was updated.%0a%0a!! Version 2.3.17 {*$:Released} (2022-12-17) [[#v2317]]%0a%0aThis release has updates for recent PHP versions.%0a%0aThe edit textarea had some improvements. Edit buttons and the automatic edit text will now insert their wiki markup in a way which allows for the "undo" function in the text area to work (with Ctrl+Z). The edit textarea (with $EnableEditAutoText enabled) now accepts 4 new keyboard shortcuts: Ctrl+L and Ctrl+Shift+L to convert the selected text to lowercase or uppercase, and Ctrl+Shift+ArrowUp or ArrowDown to move the line with the cursor up or down.%0a%0aA new variable $EnableBaseNameConfig was added - it allows to enable automatic inclusion of local configuration for the "basename" of the current page, for example Group.Page-Draft to include local/Group.Page.php if it exists.%0a%0aConditional markup %25pmhlt%25[@(:if auth @admins,@editors:)@] can now check if the current user belongs to selected usergroups (with [[AuthUser]]).%0a%0aA few minor bugs and omissions were fixed, and the documentation was updated.%0a%0a!! Version 2.3.16 {*$:Released} (2022-11-28) [[#v2316]]%0a%0aThis version fixes a bug with some skins introduced in 2.3.15 last week, and reverts PrePrintFmt(). %0a%0aNew WikiStyles 'notoc' and 'overflow' were added. PmTOC Table of contents, and the list of included pages in the edit form, now use classnames instead of style attributes.%0a%0aPmSyntax fixes a font-size alignment bug with nested programming languages, and has been optimized for large pages.%0a%0aA few more minor bugs were fixed, including for PHP 8, and the documentation was updated.%0a%0a%0a!! Version 2.3.15 {*$:Released} (2022-11-21) [[#v2315]]%0a%0aSecurity: Closed a potential XSS vulnerability discovered today. Your wiki may be at risk if untrusted people can edit your pages.%0a%0aHTTP headers: CSP updated, XSSP added. Both can be disabled or modified by changing the $HTTPHeaders values.%0a%0aCookies: Added a new variable $CookieSameSite default to 'Lax' per current browser defaults and expectations. Updated pmsetcookie() added an argument $samesite, and refactored to work with old and current PHP versions. Added function pm_session_start() as a replacement for session_start() with respect for local preferences ($CookieSameSite, $EnableCookieSecure, $EnableCookieHTTPOnly). %0a%0a[[Cookbook:PmSyntax|PmSyntax]]: A new CSS variable @@--pmsyntax-fontsize-editform@@ allows to set the font size of the edit form separately from highlighted elements in the documentation. Fixed the [@[[Highlight]]@] label could change fonts when clicked.%0a%0aResponsive skin: The font size for "pre" and "code" elements is now scalable/relative to the paragraph font size rather than fixed. This works better in headings or small text blocks.%0a%0aGUI edit buttons: Part of these functions were rewritten to avoid 'unsafe inline' JavaScript. While default and most custom buttons should work without change, you should no longer need to url-encode some characters like %25 or add backslashes. If you have such buttons, you may need to update their declarations to strip the extra backslashes. %0a%0a[[WikiStyles]]: Refactored to move all inline WikiStyles to the $HTMLStylesFmt array in the header of the HTML page.%0a%0aTables and block markup: Replaced inline @@style="..."@@ attributes with class names. %0a%0aThe function PrintFmt() was refactored to process skin parts, skin functions, markup, and wiki pages, before sending the HTTP and HTML headers. This allows for wikistyles and recipes in sidebars and footers to add their configuration to the headers.%0a%0aIf you have questions or difficulties upgrading, please contact us.%0a%0a!! Version 2.3.14 {*$:Released} (2022-11-03) [[#v2314]]%0a%0aThis version includes fixes for recent PHP versions and for 2 minor bugs (searchbox wrongly encoded entities and %25pmhlt%25[@{(ftime %25L)}@] format). Inline JavaScript for focusing form fields is now replaced with native attributes. In the Edit form, the "Minor edit" label can now toggle the checkbox.%0a%0aThe "disabled obsolete markup" tooltip now includes the file path and the line number of the markup rule definition.%0a%0aPmSyntax now recognizes %25pmhlt%25[@(:template requires? ...:)@] which is used by some recipes.%0a%0aThe documentation was updated.%0a%0a!! Version 2.3.13 {*$:Released} (2022-10-07) [[#v2313]]%0aThis version closes a potential XSS vulnerability, reported by lukystreik. A new variable $FailedLoginsFunction will allow to define a function limiting the number of failed logins. The documentation was updated.%0a%0a!! Version 2.3.12 {*$:Released} (2022-09-25) [[#v2312]]%0aThis version has a few fixes for PHP8. Complex conditionals with empty page variables could cause errors, now fixed. Form elements with values like "0" could appear empty, now fixed. The PSFT() function and the %25pmhlt%25[@{(ftime)}@] markup expression now recognize a "%25L" format as a human-readable localizable timestamp. A new helper function PrintAuthForm() was split from PmWikiAuth() to allow recipes to call it directly. The documentation was updated.%0a%0a!! Version 2.3.11 {*$:Released} (2022-08-30) [[#v2311]]%0a%0aThis version fixes the function stripmagic(), when used with arrays (a recent update for PHP 8 broke it).%0a%0aNew [[PageVariables]] derived from a Group's homepage are now available: %25pmhlt%25 [@{$GroupHomePage}@], [@{$GroupHomePageName}@], [@{$GroupHomePageTitle}@], [@{$GroupHomePageTitlespaced}@].%0a%0aA new helper function should simplify recipes with custom markup directives of the format:%0a%0a-> %25pmhlt%25 [@(:mydirective arg=val param="other value":)...(:mydirectiveend:)@].%0a%0aSee the documentation at Cookbook:MarkupDirectiveFunctions.%0a%0aThe core documentation was updated.%0a%0a%0a!! Version 2.3.10 {*$:Released} (2022-08-20) [[#v2310]]%0a%0aThis version includes updates for PHP 8. Wildcard $DefaultUnsetPageTextVars should now work with forms. PmSyntax fixed text alignment between the edit area and the colored block in some cases. The documentation was updated.%0a%0a!! Version 2.3.9 {*$:Released} (2022-08-18) [[#v239]]%0a%0aThis version includes updates for PHP 8. Non-wildcard $DefaultUnsetPageTextVars should now work with %25pmhlt%25[@(:input default:)@]. PmSyntax now handles blocks with simpler selectors, possibly created by recipes. The documentation was updated.%0a%0a!! Version 2.3.8 {*$:Released} (2022-07-22) [[#v238]]%0a%0aThis version fixes a bug caused by a recent update for PHP 8 with the include markup:%0a%0a %25pmhlt%25[@(:include Page1 Page2 Page3:)@]%0a%0aWhen the first page doesn't exist, it didn't check for the other pages (now fixed).%0a%0aIn addition, PmSyntax was improved when more than one inline blocks are on the same line, and the documentation was updated.%0a%0a%0a!! Version 2.3.7 {*$:Released} (2022-06-28) [[#v237]]%0a%0aThis version sets default HTTP headers X-Frame-Options (reported by Imagine Dragon) and Content-Security-Policy to disallow embedding in external websites by default and clickjacking attempts.%0a%0aShould you require the previous behavior, you can add this line to local/config.php:%0a%0a-> %25hlt php%25[@unset($HTTPHeaders['XFO'], $HTTPHeaders['CSP']);@]%0a%0a$EnableHighlight will now remember any links to PmWiki variables and restore them after the highlighting. %0a%0a$EnablePmSyntax will now process %25pmhlt%25[@%25hlt pmwiki%25@] in addition to [@%25pmhlt%25@] blocks, and escaped markup after it will be tentatively highlighted.%0a%0aThe documentation was updated.%0a%0a%0a!! Version 2.3.6 {*$:Released} (2022-06-19) [[#v236]]%0a%0aThis version contains fixes for PHP 8. A form attribute "lang" was added. %0a%0aSortable tables now allow for table headers to have markup such as bold (except links), and will use a case-insensitive natural ordering. %0a%0aSearchbox now has a default placeholder %25pmhlt%25 [@"$[Search]"@] and can have the submit button removed with the argument [@label=""@] (users need to press Enter on their keyboards to search).%0a%0a$EnableHighlight-formatted code blocks are now converted to plain text to prevent warnings; there is an ongoing discussion in the mailing list so this solution may evolve.%0a%0aFor developers: $UploadVerifyFunction can now modify $upname, and a variable $PageIndexTermsFunction can configure a replacement function for PageIndexTerms().%0a%0aThe documentation was updated.%0a%0a%0a!!Version 2.3.5 {*$:Released} (2022-05-23) [[#v235]]%0a%0aThis version fixes a bug with %25pmhlt%25 @@[=(:pagelist list=grouphomes:)=]@@. A new helper function DisableSkinParts() allows for simpler disabling of headers, footers and sidebars from recipes. When a file is uploaded, new variables with the file path and URL are now available to recipes.%0a%0aThe version also contains fixes for PHP 8 and documentation updates.%0a%0a%0a!!Version 2.3.4 {*$:Released} (2022-04-22) [[#v234]]%0a%0aThis version includes fixes for PHP 8 and documentation updates.%0a%0a%0a!!Version 2.3.3 {*$:Released} (2022-03-26) [[#v233]]%0a%0aThis version includes fixes for PHP 8 and documentation updates.%0a%0a%0a!!Version 2.3.2 {*$:Released} (2022-02-09) [[#v232]]%0a%0aThis version includes bug fixes and updates for PHP 8.1. The core variable $EnableIncludedPages introduced in 2.3.0 was renamed to $EnableListIncludedPages to avoid ambiguity. With LocalTimes, is now possible to configure the number of days the "plus" button will pull from the page history, and the function will better recognize some older RecentUploads formats. PmSyntax was updated so that "%25pmhlt%25@@\\@@" line breaks in tables and headings are treated like in the core, staying in the same context; and the different PmSyntax blocks will now be processed in parallel.%0a%0aThe code configuring and loading pmwiki-utils.js was moved to a new file scripts/utils.php, and a new variable $EnablePmUtils was added to allow administrators to easily disable these functions. The script pmwiki-utils.js will now be included in the page header rather than the footer, which may reduce the number of page redraws. The individual functions will now be processed in parallel.%0a%0aThe documentation was updated.%0a%0a%0a!!Version 2.3.1 {*$:Released} (2022-01-15) [[#v231]]%0a%0aThere was an omission in the release script which unexpectedly deleted the $VersionNum variable which broke some settings. This quick release fixes it.%0a%0a!!Version 2.3.0 {*$:Released} (2022-01-15) [[#v230]]%0a%0aJanuary 2022 is the 20th year anniversary of the release of PmWiki version 0.1, and 13 years since I (Petko) became core developer. This merited additional work and effort with hopefully interesting and useful new production.%0a%0a'''PHP 5.3 - 8.1 compatibility''' %0a* PmWiki 2.3.0 includes updates for PHP 8.0 and 8.1.%0a* Consequently, it requires PHP version 5.3 (released 2009) or more recent.%0a%0a'''PmSyntax'''. A new function PmSyntax was added to the core, and enabled on pmwiki.org. %0a* It highlights PmWiki syntax in the documentation, and possibly in the basic edit form. %0a* It only highlights PmWiki markup, and is independent from Highlight.js. See Cookbook:PmSyntax and $EnablePmSyntax. %0a* It should highlight most core language features and those of many recipes, see [[https://www.pmwiki.org/wiki/Test/PmSyntax|this mashup of various markups]]. %0a* Developers can add custom rules in the $CustomSyntax array, see Cookbook:CustomSyntax. %0a* The %25pmhlt%25 [@(:markup:)@] directive can now have @@class=norender@@ to only show the source code without processing it. This may be useful, together with PmSyntax, in 2 cases: writing/discussing markup code without actually running it, or working on PageList Templates where you want to see and edit them highlighted.%0a%0a'''Improvements to the edit form'''%0a* PmSyntax (above) can be enabled to highlight the PmWiki markup the edit form, and should work in recent standards-compliant browsers.%0a* The variable $EnableNotSavedWarning is now enabled by default. Add to config.php @@$EnableNotSavedWarning = 0;@@ to disable it.%0a* A new variable {- $EnableIncludedPages -} $EnableListIncludedPages (from 2.3.2) allows listing of other pages included from the currently edited page, with links to see or edit them. When the variable is enabled, the list of pages appears in the edit form, after the text area, in a collapsed %3cdetails> element. The list includes pages from which text, text variables, or templates are included from the edited page. This is enabled on pmwiki.org if you wish to preview it.%0a* The $EnableEditAutoText function will now feel more like other text editors by removing the automatically inserted bullet when Enter is pressed twice.%0a%0a'''Dates and times, monitoring, review'''%0a* The %25pmhlt%25 [@{(ftime)}@] Markup expression now accepts a new format '[@%25o@]' for the ordinal suffix of the date.%0a* The [[Notify]] feature now accepts a @@tz=@@ timezone specifier for individual subscribers. See [[Notify#tz]].%0a* A function based on Cookbook:LocalTimes was added to the core. See [[Cookbook:LocalTimes|the recipe page]] for the differences. You can continue using the recipe, or disable it and enable the core function.%0a* New core variables $EnableLocalTimes, $CurrentLocalTime.%0a* New markup %25pmhlt%25[@@2022-01-09T08:35:00Z@]%25%25 output as a %3ctime> element, formatted via $TimeFmt; localized if $EnableLocalTimes. %0a* Added a variable $EnableRecentUploads which makes it easy to enable the Recent Uploads feature on AllRecentChanges. This is a basic format that may be good enough for many wikis. For more options, see Cookbook:RecentUploadsLog.%0a* The default $RecentChangesFmt now use the variable $CurrentLocalTime instead of $CurrentTime. In the wiki source text it saves the timestamps in a portable time format in GMT, which is then shown formatted per $TimeFmt (wiki timezone). It looks just like $CurrentTime did previously, but can be converted to the visitor's time zone if LocalTimes is enabled. If you have custom $RecentChangesFmt entries that use $CurrentTime, nothing will change for you, but you may want to update these with $CurrentLocalTime if you want to benefit from localization.%0a* The "page history" page now has CSS classes for the delay between edits: diffday, diffweek, diffmonth, diffyear. These allow styling of vertical spacing between individual edits in page histories. See Cookbook:DiffDelay for an example.%0a* The page history can now have a "hidden" edit type, in addition to "minor". This is intended to be used by recipes in order to hide, rather than delete, some edits from the page history. A couple of new recipes using this feature will be added in the next few days.%0a%0a'''PageLists, categories, backlinks'''%0a* [[PageLists]] now accept a new argument @@category=Name@@ which lists only pages declared in the category with the markup %25pmhlt%25 [@[[!Name]]@], and does not include pages simply linking to [@[[Category/Name]]@] (unless they also contain [@[[!Name]]@]).%0a** The differentiation between links to !Name and Category.Name requires the pages containing category links to be re-indexed; see Cookbook:ReindexCategories which can automate this.%0a* Also in PageLists, the arguments @@link=@@ and @@category=@@ now accept multiple and negative specifiers, and wildcards. See [[PageLists#wildcards]]. If you previously used the recipe Cookbook:PageListMultiTargets, please disable it when you upgrade to 2.3.0.%0a* Category links can now have a different text, like %25pmhlt%25 [@[[!Name|Text]]@], and the markup generally behaves like other links, see PITS:01095.%0a%0a'''Styles''' (core skin PmWiki-responsive)%0a* Collapsible sections details+summary will now change the cursor to the "pointer" style over the clickable element, and the color will change to "navy". %0a* The core table of contents function ($PmTOC) has had its styles updated, in order to properly indent long sub-headings.%0a%0a'''Core helper functions'''%0a* A new helper function %25hlt php%25@@PSFT()@@ can now be used as an ''almost'' drop-in replacement for @@strftime()@@ and @@gmstrftime()@@ which became deprecated in PHP 8.1. Please review the documentation at [[Functions#PSFT]]. If you have local configurations or recipes using @@strftime()@@ you can change for @@PSFT()@@ now.%0a* A helper function %25hlt php%25@@DownloadUrl($pagename, $path)@@ was added, see [[Functions#DownloadUrl]]. It can simplify the handling of attached files by recipes.%0a%0aLast but not least, '''the documentation''' in English has been updated with the latest development (and in German by MFWolff).%0a%0aSee also [[Upgrades#v22v23|Upgrading from version 2.2.145 to 2.3.0]].%0a%0aAs always, if you have any questions or difficulties, please let us know.%0a%0a%0a!! Version 2.2.145 {*$:Released} (2021-12-11) [[#v22145]]%0aThis version includes a minor change in search patterns: searches and pagelists with a wrong or undefined $SearchPatterns (@@list=abc@@ argument) will now use $SearchPatterns["default"] rather than an empty array (effectively all pages). This was likely the intended behavior, a way for admins to restrict search locations.%0a%0aIt also includes updates for PHP 8, a fix of an emoji for non-UTF8 wikis, and the latest pages of the documentation.%0a%0a!! Version 2.2.144 {*$:Released} (2021-11-06) [[#v22144]]%0aThis version includes fixes for PHP 8 and an update to @@intermap.txt@@. The conditional markup "exists" was optimized when called multiple times. The functions %25hlt php%25@@CondExists()@@, @@MatchPageNames()@@, and @@MatchNames()@@, can now be called with an additional argument (false) when a case-sensitive match is needed. The documentation was updated.%0a%0a!! Version 2.2.143 {*$:Released} (2021-10-02) [[#v22143]]%0aThis version should prevent some errors from local customization or recipes with recent PHP versions, by disabling obsolete markup rules and replacement patterns. If such markup appears on a page, it will not be processed, it will be rendered like this: %25frame%25@@⚠(:my-obsolete-directive params:)@@%25%25 and a tooltip title should have some additional information.%0a%0aCare should be taken if you have custom calls to the deprecated function [[PmWiki/Functions#PCCF|%25hlt php%25@@PCCF()@@]], and incompatible custom replacement patterns processed via [[PmWiki/Functions#PPRE|@@PPRE()@@]] or [[PmWiki/Functions#PPRA|@@PPRA()@@]] are silently skipped, which may not work as expected. (Previously they wouldn't work at all.)%0a%0aIf you experience any difficulties, please do let us know and we'll try to provide a fix.%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.142 {*$:Released} (2021-08-31) [[#v22142]]%0aThis version hides some PHP 8 notices, and adds 2 new form element attributes "accept" and "autofocus". %0a%0aThe documentation was updated.%0a%0a%0a!! Version 2.2.141 {*$:Released} (2021-07-09) [[#v22141]]%0aThis version adds ways to define 2 custom functions:%0a* $MultiFactorAuthFunction to enable custom MFA/2FA with [[AuthUser]]%0a* $PageIndexFoldFunction to define a custom function normalizing the page terms while indexing and searching (by default PmWiki converts the terms to lowercase).%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.140 {*$:Released} (2021-06-26) [[#v22140]]%0aThis version has updates for PHP 8. %0a%0aThe API of the source code highlighting library has changed and the PmWiki loader function was adapted; if you use this feature, please upgrade Highlight.js to version 11.0.0 or newer. %0a%0aNote: since version 11, Highlight.js doesn't preserve HTML in the preformatted blocks and issues a console warning, so you should only use the [@(space)[=escaped=]@] or the @@[=[@escaped@]=]@@ markup blocks.%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.139 {*$:Released} (2021-05-05) [[#v22139]]%0aThis version removes empty "title" attributes in HTML tags (links and images), fixes warnings which appear with PHP 8 and updates the documentation.%0a%0a!! Version 2.2.138 {*$:Released} (2021-03-02) [[#v22138]]%0aThis version fixes a bug when a details directive has markup in the summary attribute, and the documentation was updated.%0a%0a!! Version 2.2.137 {*$:Released} (2021-02-26) [[#v22137]]%0aThis version fixes a bug introduced earlier today with entities encoded twice in PQA() quoted arguments.%0a%0a!! Version 2.2.136 {*$:Released} (2021-02-26) [[#v22136]]%0aThis version fixes a XSS vulnerability for WikiStyles reported today by Igor Sak-Sakovskiy.%0a%0aThe fix adds a second argument $keep to the core function PQA($attr, $keep=true) which by default escapes HTML special characters and places the values in Keep() containers. If you have custom functions that call PQA() and expect the previous behavior, call PQA() with a second argument set to false.%0a%0aIf you have any questions or difficulties, please let us know.%0a%0a!! Version 2.2.135 {*$:Released} (2021-01-31) [[#v22135]]%0aThis version fixes a number of PHP8 compatibility issues. This is a work in progress, if you uncover others, please report them at PITS:01461.%0a%0aA work is underway to implement session tokens to prevent CSRF vulnerabilities -- suggested by Dominique Faure. I wanted to rework these functions but the PHP8 compatibilities are more urgent so at the moment the PmToken functions are transparent/non-functional.%0a%0aA defunct syndicated blocklist was disabled, a minor code refactoring was done for PmTOC to better support manual edit section links, and the documentation was updated.%0a%0a%0a!! Version 2.2.134 {*$:Released} (2020-11-30) [[#v22134]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.133 {*$:Released} (2020-10-25) [[#v22133]]%0aThis version fixes a potential vulnerability to CWE-384: Session Fixation, reported by Dominique Faure. The fix regenerates the session identifier at the moment someone logs in. In case this is not desirable, a wiki admin can set the new variable $EnableAuthPostRegenerateSID to false.%0a%0aThis version also fixes an unintended variable evaluation in link markups. The CSS from Cookbook:RecipeCheck will now be injected only when needed. The responsive skin styles contained a reduced padding value for numbered and bulleted lists in order to save space, but in longer lists it could clip the item numbers. This value was removed from the styles because it was complex to reliably override it from local configuration. If you need to enable the previous values, add to pub/css/local.css the following:%0a%0a%25hlt css%25[@%0aul, ol { padding: 0 0 0 20px; }%0a@media screen and (min-width:50em) {%0a ul, ol { padding: 0 0 0 40px; }%0a}@]%0a%0a!! Version 2.2.132 {*$:Released} (2020-09-30) [[#v22132]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.131 {*$:Released} (2020-08-30) [[#v22131]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.130 {*$:Released} (2020-07-04) [[#v22130]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.129 {*$:Released} (2020-05-21) [[#v22129]]%0aThis version adds the styles for the "simpletable" class of tables from the "pmwiki-responsive" skin into the old "pmwiki" skin, and the documentation was updated.%0a%0a!! Version 2.2.128 {*$:Released} (2020-04-26) [[#v22128]]%0aThis version only includes some cosmetic changes and updates the documentation.%0a%0a!! Version 2.2.127 {*$:Released} (2020-03-23) [[#v22127]]%0aThis version sets the maximum height of the edit form textarea after reports for a jumping behavior on mobile devices (the PmWiki-responsive skin only). The core table of content classes "pmtoc-show" and "pmtoc-hide" now replace the previous classes "show" and "hide" to prevent conflicts with other frameworks. The functionality of the recipe Skins:SkinChange was added to the core (disabled by default). The documentation was updated.%0a%0a!! Version 2.2.126 {*$:Released} (2020-02-01) [[#v22126]]%0aThis version fixes a bug with $PmTOC['MinNumber'] set to -1, and updates the .htaccess format for caches.php. The documentation was updated.%0a%0a!! Version 2.2.124, 2.2.125 {*$:Released} (2020-01-27) [[#v22125]]%0aThis version adds a variable $SetCookieFunction to override the core "pmsetcookie" function. A new feature ToggleNext was included in the core, documented at Cookbook:ToggleNext. The documentation was updated.%0a%0a!! Version 2.2.123 {*$:Released} (2019-12-31) [[#v22123]]%0aThis version allows link URLs to be [[Links#escaped | escaped]] with [@[=link address=]@] if they contain any special characters, including quotes, parentheses and pipes. The obfuscated e-mails will now work from headers, footers and sidebars. A [[forms|form]] attribute "formnovalidate" was added to the core and to the "Cancel" button in the edit form. Core [[table of contents]] will now work better with Cookbook:SectionEdit. Cookbook:RecipeCheck was included in the core -- if you have this recipe already installed, you can simply comment it out from your config.php. The code that handles $EnableRCDiffBytes was refactored to also show the bytes changed in the page histories. New upload extensions [[https://developers.google.com/speed/webp | "webp"]] (images) and [[https://www.opus-codec.org/ | "opus"]] (audio) were added. The documentation was updated.%0a%0a!! Version 2.2.122 {*$:Released} (2019-11-19) [[#v22122]]%0aVersion 2.2.121 was released by mistake and contained some experimental code that was meant to be tested first. %0a%0aThis version fixes a bug with ObfuscateLinkIMap() and international characters. New configuration variables $DefaultUnsetPageTextVars, $DefaultEmptyPageTextVars can set default values for page text variables. The built-in table of contents and numbered headings can now be enabled independently. A pagelist template pseudovariable [@{$$EachCount}@] was added, containing the number of the page in the current "each" loop. Input form elements and the [@(:searchbox:)@] field now can have ARIA accessibility attributes.%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.120 {*$:Released} (2019-10-13) [[#v22120]]%0aThis version fixes a bug with existing complex customization of GUIEdit buttons. Very long [[table of contents|tables of contents]] will now be scrollable. A new "input datalist" [[Forms|form]] element (list of suggestions to other input fields), and a new "details+summary" [[block markup|block section]] (toggle sections without JavaScript) were added. The documentation was updated.%0a%0a!! Version 2.2.119 {*$:Released} (2019-10-03) [[#v22119]]%0aThis version updates the core for PHP 7.4. Required input fields now feature @@required="required"@@ attributes and modern browsers prevent sending the edit or upload form with empty required fields. Attachlist @@ext=@@ and @@names=@@ arguments now accept patterns and negatives like @@ext=jpg,png@@, @@ext=-pdf@@, or @@names=-th*---*.jpg@@. The Redirect function can now have a 3rd argument with the full URL. The scroll position in the edit text area will be remembered on save-and-edit and preview. A bug was fixed with pagelist while preview. The documentation was updated.%0a%0aA number of features currently provided by recipes were added to the core and disabled by default. You can still use the recipes, or you can disable them and enable the core features. The following features were added:%0a* e-mail obfuscation functions based on Cookbook:DeObMail; see instructions to enable%0a* a FixUrl button based on Cookbook:FixURL, see $EnableGuiEditFixUrl%0a* $EnableNotSavedWarning based on Cookbook:NotSavedWarning%0a* $EnableEditAutoText based on Cookbook:EditHelp%0a* $PmTOC, [@(:toc:)@], [@(:notoc:)@], Table of contents/Numbered headings, based on a simplified variant of Cookbook:AutoTOC%0a* $EnableSortable, basic sortable tables%0a* $EnableRCDiffBytes based on Cookbook:DeltaBytesRecentChanges%0a* $EnableSimpleTableRowspan replicating the markup from Cookbook:RowspanInSimpleTables%0a* $WikiPageCSSFmt enables CSS in a wiki page, based on Cookbook:LocalCSS%0a* $EnableHighlight code highlight feature compatible with "highlight.js"%0a* $AddLinkCSS['othergroup'] and $AddLinkCSS['samedomain'] can contain custom CSS classes for in-wiki links to other groups and for URL links to the same site.%0a%0aThe above new features are disabled by default, see the documentation for more information on how to enable them, or test them on pmwiki.org where most of these are enabled. Please report if you notice any problems.%0a%0a!! Version 2.2.118 {*$:Released} (2019-08-28) [[#v22118]]%0aThis version integrates the features of the recipe Cookbook:PreviewChanges into the core. If you currently use this recipe, please uninstall it and add to config.php:%0a $EnablePreviewChanges = 1;%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.117 {*$:Released} (2019-07-28) [[#v22117]]%0aThis version adds handling of "partial content" requests for file downloads. New video file extensions 'm4v' and '3gp' were added. The Upload form now includes a new text field "Uploader" pre-filled with the name of the editor, and a new variable $EnableUploadAuthorRequired was added (defaults to $EnablePostAuthorRequired). The documentation was updated.%0a%0a!! Version 2.2.116 {*$:Released} (2019-06-19) [[#v22116]]%0aThis version fixes pagelists with case insensitive matches of page (text) variables for international wikis. If your international wiki pagelists rely on case-sensitive variable matches, please see $PageListVarFoldFn. The documentation was updated.%0a%0a!! Version 2.2.115 {*$:Released} (2019-05-13) [[#v22115]]%0aIn this version the responsive skin in large "desktop" mode changes the search form background to transparent, for easier custom styling of the header. The documentation was updated.%0a%0a!! Version 2.2.114 {*$:Released} (2019-04-02) [[#v22114]]%0aThis version adds a skin directive @@%3c!--IncludeTemplate ... -->@@ and the variable $SkinTemplateIncludeLevel. The core variable documentation format identifiers were moved to the definition term element to allow CSS ":target" styling, and the header and link text of the vardoc table can now be translated. Input forms have a new HTML5 element "tel", a new attribute "pattern" and two bugs were fixed with the classnames of the new elements and with the identifiers of "select" lists. The documentation was updated.%0a%0a!! Version 2.2.113 {*$:Released} (2019-03-01) [[#v22113]]%0aThis version adds a new [@(:input button:)@] form element. All form elements can now accept custom data-* attributes, which can be disabled by setting $EnableInputDataAttr to 0. Both additions are meant for easier integration with custom JavaScript functions or some frameworks.%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.112 {*$:Released} (2019-01-09) [[#v22112]]%0aThis version includes a fix for PHP 7.3, and the documentation was updated.%0a%0a!! Version 2.2.111 {*$:Released} (2018-12-08) [[#v22111]]%0aThis version updates core .htaccess files to be compatible with both Apache 2.4 and earlier versions, and the variable $DenyHtaccessContent was added with the updated content. In case of difficulties or questions please contact us.%0a%0aA CSS value in the pmwiki-responsive skin was fixed. The [[MarkupExpression(s)]] [@{(ftime )}@] now accepts @@tz=@@ (time zone) and @@locale=@@ (language locale) arguments. The documentation was updated.%0a%0a!! Version 2.2.110 {*$:Released} (2018-11-05) [[#v22110]]%0aThis version prevents a warning with the [@{(substr )}@] markup expression when non-number arguments are typed. A new variable $PageListSortCmpFunction allows custom functions to order page lists. A new variable $MarkupMarkupLevel indicates when the processing happens inside [@(:markup:)@] blocks. %0a%0aThe default style for @@[=[@escaped code@]=]@@ dropped white spaces inconsistently and was fixed. If you rely on the previous behavior please add this to your pub/css/local.css file to revert it:%0a%0a code.escaped { white-space: nowrap; }%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.109 {*$:Released} (2018-07-09) [[#v22109]]%0aThis version fixes a bug with the Path: InterMap prefix which was broken in 2.2.108. The function pmcrypt() was updated to prevent more strings from causing "invalid hash" warnings in PHP 7. The variable $EnableMarkupDiag was added to help diagnose all markup calls. The documentation was updated.%0a%0a!! Version 2.2.108 {*$:Released} (2018-07-05) [[#v22108]]%0aThis version adds the $PCCFOverrideFunction variable allowing a custom function to override PCCF(). $AuthUserPageFmt can now be an array of page names. The page cache file name can now be customized. Form checkbox labels now have the same tooltip title as the checkbox. Ordered lists with the [@%25reversed%25@] WikiStyle will have descending numbers. Minor fixes to refcount.php, vardoc.php, and pmcrypt(). The default InterMap PmWiki URLs have now the HTTPS protocol. The documentation was updated.%0a%0a!! Version 2.2.107 {*$:Released} (2018-02-02) [[#v22107]]%0aThis version includes more fixes for PHP 7.2 for forms and pagelists. A new variable $MailFunction allows administrators and developers to write replacement functions for the PHP function "mail()". Styles were improved for right-to-left text blocks embedded into left-to-right texts (and vice versa). The documentation was updated.%0a%0a!! Version 2.2.106 {*$:Released} (2017-12-01) [[#v22106]]%0aThis version has a rewrite of the function PageListSort() to allow it to work with PHP 7.2, and fixes a bug with the backtick (escape) [@`WikiWord@] markup. The helper function pmsetcookie() and the variables $EnableCookieSecure, $EnableCookieHTTPOnly were added to allow easy setting of secure cookies. The documentation was updated.%0a%0a!! Version 2.2.105 {*$:Released} (2017-11-07) [[#v22105]]%0aThis version fixes a bug with the PQA() function causing invalid HTML with attributes glued together. The function @@HandleUpload()@@ was refactored and @@UploadSetVars($pagename)@@ was added to allow upload-managing add-ons to set variables more easily.%0a%0aIf you upgrade from 2.2.98 or earlier, and you have custom markup rules relative to author signatures, please see note about [[#v2299|change in 2.2.99]] (documented November 2017).%0a%0a!! Version 2.2.104 {*$:Released} (2017-10-11) [[#v22104]]%0aThis version fixes a bug with [[WikiTrails#pathtrail|path WikiTrails]] reported today.%0a%0a!! Version 2.2.103 {*$:Released} (2017-10-01) [[#v22103]]%0aThis 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.%0a%0aPagelists 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.%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.102 {*$:Released} (2017-08-05) [[#v22102]]%0aThis version reverts the patterns for text variables changed in 2.2.99, because we found that a longer text variable content may cause a blank page or an internal server error. In the page [[SiteAdmin.AuthList]] an input box was added to allow filtering of the groups or pages.%0a%0a!! Version 2.2.101 {*$:Released} (2017-07-30) [[#v22101]]%0aThis version renames the internal constructor of the PageStore class to be compatible with both PHP 5 and PHP 7. Previously, the PageStore class had two constructors for PHP 4 and PHP 5 compatibility of which one was silently ignored, but recent PHP 7 versions display strict or deprecated notices when the PHP 4 constructor is used.%0a%0aIf you must use PmWiki 2.2.101 or newer on a PHP 4 installation, please contact me so I can provide you with a workaround.%0a%0a!! Version 2.2.100 {*$:Released} (2017-07-30) [[#v22100]]%0aThis version provides a workaround for an incompatibility with our Subversion version control system, where the $Author wiki variable was considered a Subversion variable. A fix for the responsive skin adds some spacing above the WikiText block. The documentation was updated.%0a%0a!! Version 2.2.99 {*$:Released} (2017-06-26) [[#v2299]]%0aThis version fixes a bug where an incomplete text variable without a closing parenthesis like "[@(:Var:Value@]" could hide the remaining of the page.%0a%0aA bug was fixed where previewing a page didn't show changes to be done by replace-on-save patterns (the function ReplaceOnSave was refactored). Markup rules for previewing author signatures are no longer needed and were removed. %25note%25 Note that if you had custom markup rules processed before or after the @@[=~~=][=~=]@@ or @@[=~~=][=~~=]@@ author signatures may need to be set to [@'%3c[[~'@] (second argument of the @@Markup@@ call).%0a%0aA bug and a warning for PHP 4 installations were fixed. Two minor bugs with the [@[[%3c%3c]]@] line break for the responsive skin and the $Version variable link in the documentation were fixed. %0a%0aThe InterMap prefix to Wikipedia was corrected to use the secure HTTPS protocol and the documentation was updated.%0a%0a!! Version 2.2.98 (2017-05-31) [[#v2298]]%0aThis version adds a new skin that is better adaptable to both large and small screens, desktop and mobile devices (touchscreens). The new skin "pmwiki-responsive" is not enabled by default but available as an option, and as a base for customized copies. It requires a relatively modern browser (post-2009). The old skin is still available and enabled by default.%0a%0aThe Vardoc links now use MakeLink() to allow a custom LinkPage function. The function ReplaceOnSave() was refactored to allow easier calling from recipes. Markup processing functions now can access besides $pagename, a $markupid variable that contains the "name" of the processed markup rule, allowing a single function to process multiple markup rules. The "*.mkv" video extension was added to the list of allowed uploads.%0a%0aA bug was fixed with the [@(:markup:)@] output where a leading space was lost. Note that the "markup" frame is now wrapped in a %3cpre> block with a "pre-wrap" style instead of %3ccode>.%0a%0aA number of other (minor) bugs were fixed: see ChangeLog, and the documentation was updated.%0a%0a!! Version 2.2.97 (2017-04-07) [[#v2297]]%0aThis version fixes a bug concerning $ScriptUrl when $EnablePathInfo is set, introduced in 2.2.96 and reported by 3 users.%0a%0a!! Version 2.2.96 (2017-04-05) [[#v2296]]%0aThis version fixes a severe PHP code injection vulnerability, reported by Gabriel Margiani. PmWiki versions 2.2.56 to 2.2.95 are concerned.%0a%0aOnly certain local customizations enable the vulnerability. Your website may be at risk if your local configuration or recipes call too early some core functions like CondAuth(), RetrievePageName() or FmtPageName(), before the $pagename variable is sanitized by ResolvePageName() in stdconfig.php. A specific URL launched by a malicious visitor may trigger the vulnerability.%0a%0aMost recipes call core functions from a $HandleActions function, or from a Markup expression rule, these do not appear to be affected by the current exploit.%0a%0aIf your wiki may be at risk, it is recommended to upgrade to version 2.2.96 or most recent at the earliest opportunity. If you cannot immediately upgrade, you should place the following line in your local (farm)config.php file:%0a%0a [@$pagename = preg_replace('![${}\'"\\\\]+!', '', $pagename);@]%0a%0aPlace this line near the top of the file but after you include scripts/xlpage-utf-8.php or other character encoding file.%0a%0aThis version filters the $pagename variable to exclude certain characters. A new variable $pagename_unfiltered is added in case a recipe requires the previous behavior. The documentation was updated.%0a%0a!! Version 2.2.95 (2017-02-28) [[#v2295]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.94 (2017-01-31) [[#v2294]]%0aThis version allows webmasters to configure and use both .html and .htm extensions. The cached information about whether a page exists or not will now be cleared when that page is created or deleted. The documentation was updated.%0a%0a!! Version 2.2.93 (2016-12-31) [[#v2293]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.92 (2016-11-30) [[#v2292]]%0aThis version allows administrators to disable the "nopass" password by setting $AllowPassword to false. The function FmtPageName() will now expand PageVariables with asterisks like [@{*$FullName}@]. The documentation was updated.%0a%0a!! Version 2.2.91 (2016-09-30) [[#v2291]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.90 (2016-08-31) [[#v2290]]%0aThis version adds a parameter to the upload form which can improve analytics from the server logs. Two new CSS classes were added to help skin developers: @@imgonly@@ and @@imgcaption@@, for standalone embedded pictures with or without a caption. A bug with the plus-links was fixed. The documentation was updated.%0a%0a!! Version 2.2.89 (2016-07-30) [[#v2289]]%0aThis version allows to set a default class name for simple tables. The [@(:searchbox:)@] directive can now have a "placeholder" attribute, and the input type can be changed from "text" to "search" for HTML5 websites. The edit form elements have now identifier attributes to allow easier styling. All core scripts will now inject CSS into the skin only if it hasn't already been defined. The vardoc.php script now recognizes and links to the documentation for the variables $pagename, $Author and $Skin. The documentation was updated.%0a%0a!! Version 2.2.88 (2016-06-29) [[#v2288]]%0aThis version fixes invalid HTML output of some WikiTrail links. The function PHSC() can now have an optional fourth argument for a safe replacement of htmlspecialchars(). A new page variable [@{$SiteAdminGroup}@] was added and the documentation was updated. %0a%0a!! Version 2.2.87 (2016-05-31) [[#v2287]]%0aThis version adds the $HTMLTagAttr variable to be used in the %3chtml> tag in skins for additional attributes like "lang" or "manifest". To enable it, use it in your skin, for example:%0a%0a %3chtml xmlns="http://www.w3.org/1999/xhtml" $HTMLTagAttr>%0a%0aThe variable $EnableRevUserAgent, if set to 1, will cause the User-Agent string from browsers to be stored with each page history entry (as opposed to only storing the last user agent string). The output variable $DiffUserAgent can be used in history templates like $DiffStartFmt.%0a%0aA wrong page variable in [[Site.UploadQuickReference]] was corrected, and the documentation was updated.%0a%0a!! Version 2.2.86 (2016-04-28) [[#v2286]]%0aThis version adds updates for PHP 7, for the PageStore() class and for the $DefaultPasswords default/unset definitions (no action should be needed upon upgrades). The documentation was updated.%0a%0a!! Version 2.2.85 (2016-03-31) [[#v2285]]%0aThis version adds Scalable Vector Graphics (*.svg, *.svgz) as allowed uploads and as embeddable picture extensions (with the html tag %3cimg/>). The documentation was updated.%0a%0a!! Version 2.2.84 (2016-02-21) [[#v2284]]%0aThis version fixes "indent" and "outdent" styles for right-to-left languages. A new variable $EnableLinkPlusTitlespaced allows "plus links" [@[[Link|+]]@] to display the "Spaced Title" of the page instead the "Title". The documentation was updated.%0a%0a!! Version 2.2.83 (2015-12-31) [[#v2283]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.82 (2015-11-30) [[#v2282]]%0aThis version enables stripmagic() to process arrays recursively and updates the documentation.%0a%0a!! Version 2.2.81 (2015-10-31) [[#v2281]]%0aThis version fixes an inconsistency with single line page text variables. International wikis enabling UTF-8 will now be able to use the CSS classes "rtl" and "ltr" to override the text direction when inserting right to left languages. The documentation was updated.%0a%0a!! Version 2.2.80 (2015-09-30) [[#v2280]]%0aThis version modifies the [@(:searchbox:)@] directive to use type="search" semantic input, and updates the documentation.%0a%0a!! Version 2.2.79 (2015-08-27) [[#v2279]]%0aThis version adds WikiStyles for the CSS basic colors "fuchsia", "olive", "lime", "teal", "aqua", "orange" and "gray"/"grey". New input elements "email", "url", "number", "date", and "search" can now be used in wiki forms. %0a%0aNote: the "target" attribute of input forms which was added in the previous version broke the PmForm processor, and was removed until we find a solution. If you don't use PmForm and require this attribute (or others), the usual way to add it is to redefine the $InputAttrs array in your local configuration.%0a%0aA new variable $EnableROSEscape can be set to 1 if $ROSPatterns and $ROEPatterns should not process source text wrapped with [@[=...=]@] or @@[=[@...@]=]@@. By default "replace on edit" patterns are performed even in such text.%0a%0aThe insMarkup() function in guiedit.js was refactored to allow custom input ids and/or custom functions to process the selected text.%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.78 (2015-07-21) [[#v2278]]%0aThis version updates the $RobotPattern list with currently active user agents. {-Input forms can have a "target" attribute-} (removed in 2.2.79). The documentation was updated.%0a%0aNote, this release broke the Cookbook:PmForm module. Please do upgrade to 2.2.79 or newer if your wiki uses PmForm.%0a%0a!! Version 2.2.77 (2015-06-19) [[#v2277]]%0aThis version extends the [@(:if attachments:)@] conditional to specify file and page names. A [@{$WikiTitle}@] page variable was added. A MatchNames() function was introduced as a generic way to match array values the same way MatchPageNames() does currently with lists of pages -- recipe authors can use it to get a subset of attachments for example. The PageStore() class was slightly optimized when recoding pages from-to UTF-8. The documentation was updated.%0a%0a!! Version 2.2.76 (2015-05-31) [[#v2276]]%0aThis version improves support for arrays in form elements: setting default values and recovering values from posted forms. A new "label" argument to checkbox and radio input elements allows easy insertion of clickable text labels after the form elements. Division blocks wrapping standalone images, and standalone image captions, now receive CSS classes allowing greater control via stylesheets. The documentation was updated.%0a%0a!! Version 2.2.75 (2015-04-26) [[#v2275]]%0aThis version adds a pmcrypt($pass, $salt) function which can be used as a replacement for the PHP crypt() function when encrypting passwords. From PHP 5.6 on, crypt() should not be used without a $salt parameter and would raise a notice. If pmcrypt() is called with a $salt parameter it will simply call crypt() in order to check a password. If it is called without a $salt parameter, pmcrypt() will create a password hash with the password_hash() function or with crypt() depending on your installation. You can replace any calls to crypt() with pmcrypt(), notably in config.php when defining $DefaultPasswords entries.%0a%0aMarkup was added for the semantic HTML5 tags article, section, nav, header, footer, aside, address.%0a%0aA bug with the uploads feature was fixed when $EnableReadOnly is set, and the documentation was updated.%0a%0a!! Version 2.2.74 (2015-03-28) [[#v2274]]%0aThis version allows the translation of the word "OK" in authentication forms. The documentation was updated to the latest state on pmwiki.org.%0a%0a!! Version 2.2.73 (2015-02-28) [[#v2273]]%0aThis release only updates the documentation to the latest state on pmwiki.org.%0a%0a!! Version 2.2.72 (2015-01-27) [[#v2272]]%0aThis version improves the ?action=ruleset display for markup rules potentially incompatible with PHP 5.5 when the function debug_backtrace() is not available. It restores the ability to set a custom function handling the [=(:markup:)=] demos. A variable $AbortFunction was added allowing administrators to override the core Abort() function. The documentation was updated.%0a%0a!! Version 2.2.71 (2014-12-29) [[#v2271]]%0aThis version removes the hard word wrap in [@(:markup:)@] wikicode examples, and instead of %3cpre> tags, it wraps it in %3ccode> tags. This allows newcomers to copy and paste the code in their wikis without inserted line breaks (which often cause the markup to not work).%0a%0aThe release also adds back-tracing for markup rules potentially incompatible with PHP 5.5. Such rules, often added by recipes, can trigger "Deprecated: preg_replace()" warnings. To find out which recipes may trigger the warnings, enable diagnostic tools in config.php with @@$EnableDiag = 1;@@ then open a page with the 'ruleset' action, eg. [@[[HomePage?action=ruleset]]@]. The PHP-5.5-incompatible rules will be flagged with filenames, line numbers and patterns. See also the pages [[(PmWiki:)Troubleshooting]] and [[(PmWiki:)CustomMarkup]] on pmwiki.org.%0a%0aThe variable $DraftActionsPattern was added, the pagelist "request" parameter can now contain a list of allowed or disallowed parameters that can be overridden by the user, the "input default source" parameter can now contain multiple pages, and a minor bug was fixed in upload.php ('strict' warning). See the updated documentation for more information. %0a%0a!! Version 2.2.70 (2014-11-08) [[#v2270]]%0aThis release only updates the documentation to the latest state on pmwiki.org.%0a%0a!! Version 2.2.69 (2014-10-13) [[#v2269]]%0aThis version fixes a bug when dates are defined as relative to other dates, eg. "2014-10-13 -3 days". The documentation was updated; note that the instructions in Site.UploadQuickReference were updated to reflect the display of the upload form in current browsers.%0a%0a!! Version 2.2.68 (2014-09-01) [[#v2268]]%0aThis version adds a Skins: InterMap prefix pointing to the Skins section on PmWiki.org, a "signature" markup in the edit quick reference, new WikiStyles clear, min-width and max-width and the documentation was updated.%0a%0a!! Version 2.2.67 (2014-08-02) [[#v2267]]%0aThis version fixes an inconsistency with input forms when values are taken from PageTextVariables. The documentation was updated to the latest state on pmwiki.org.%0a%0a!! Version 2.2.66 (2014-07-02) [[#v2266]]%0aThis version fixes a minor longstanding bug in the default Notification format when a page is deleted. In custom patterns, the "_" character will no longer be considered a function name. The documentation was updated.%0a%0a!! Version 2.2.65 (2014-06-07) [[#v2265]]%0aThis version fixes Pagelist handling of [@{$$PseudoVars}@] when they contain page variables. File permissions handling was improved when the current directory is owned by "root". The documentation was updated.%0a%0a!! Version 2.2.64 (2014-05-08) [[#v2264]]%0aThis version adds the [="{(mod)}"=] markup expression for modulo/remainder calculations, and the "tel:" and "geo:" URI schemes which, on compatible devices like smartphones, allow the creation of links to dial telephone numbers and open map/location applications. %0a%0aThe $SysMergePassthru switch was added, if enabled, it allows the "Simultaneous Edits" conflict resolution to use the passthru() function instead of popen().%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.63 (2014-04-05) [[#v2263]]%0aThis version allows for form elements to have custom attributes containing a dash in the attribute names and enables the attributes 'required', 'placeholder' and 'autocomplete' for HTML5 forms. A minor bug with pagelist [={$$RequestVariables}=] appearing on some installations was fixed. The documentation was updated.%0a%0a!! Version 2.2.62 (2014-02-28) [[#v2262]]%0aThis version adds the variable $EnableTableAutoValignTop which allows to make advanced tables compatible with HTML5. For developers, a fourth argument $template was added to the Markup_e() function, and a callback template 'return' was added. The documentation was updated.%0a%0a!! Version 2.2.61 (2014-01-31) [[#v2261]]%0aThis version removes unnecessary snippets of code and adds the variable $TableCellAlignFmt which allows to make simple tables compatible with HTML5. The documentation was updated.%0a%0a!! Version 2.2.60 (2014-01-12) [[#v2260]]%0aThis version reverts the changes to the pmwiki.css file made in 2.2.59. %0a%0a!! Version 2.2.59 (2014-01-11) [[#v2259]]%0aThis version has an improvement for Blocklist when multiple text fields are posted. A bug with some nested markup conditionals was fixed. The default skin switched font sizes from points (fixed) to percents (relative). A couple of other minor bugs were fixed and the documentation was updated.%0a%0a!! Version 2.2.58 (2013-12-25) [[#v2258]]%0aThis version enables customization of [=(:input auth_form:)=], and fixes a couple of minor bugs. The documentation was updated.%0a%0a!! Version 2.2.57 (2013-11-03) [[#v2257]]%0aThis version enables the use of the Attach: link format in the [[PmWiki/PageDirectives#attachlist|[=(:attachlist:)=]]] directive. The documentation was updated.%0a%0a!! Version 2.2.56 (2013-09-30) [[#v2256]]%0aThis version aims to fix a PHP 5.5 compatibility issue with a deprecated feature of the preg_replace() function. The PageStore() class now detects and works around a bug with the iconv() function, and the documentation was updated.%0a%0a!! Version 2.2.55 (2013-09-16) [[#v2255]]%0aThis version adds the variable $EnableDraftAtomicDiff. If enabled, publishing from a draft version will clear the history of intermediate draft edits, and the published version will contain a single combined diff from the previous published version. The documentation was updated.%0a%0a!! Version 2.2.54 (2013-08-13) [[#v2254]]%0aThis version fixes a bug when old versions are restored from draft pages. The documentation was updated.%0a%0a!! Version 2.2.53 (2013-07-08) [[#v2253]]%0aThis version enables a message to be shown when a post is blocked because of too many unapproved links. The documentation was updated.%0a%0a!! Version 2.2.52 (2013-06-08) [[#v2252]]%0aThis version hides warnings about a deprecated feature in PHP 5.5 installations (preg_replace with /e eval flag). Three new upload extensions were added: docx, pptx and xlsx produced by recent versions of some office suites. The documentation was updated.%0a%0a!! Version 2.2.51 (2013-05-08) [[#v2251]]%0aThis version updates the addresses for the remote blocklists. A minor XSS vulnerability for open wikis, which was discovered today, was fixed. The documentation was updated.%0a%0a!! Version 2.2.50 (2013-04-08) [[#v2250]]%0aThis release only updates the documentation to the latest state on pmwiki.org.%0a%0a!! Version 2.2.49 (2013-03-09) [[#v2249]]%0aThis version adds an array $UploadBlacklist containing forbidden strings of an uploaded filename (case insensitive). Some Apache installations try to execute a file which has ".php", ".pl" or ".cgi" anywhere in the filename, for example, "test.php.txt" may be executed. To disallow such files to be uploaded via the PmWiki interface, add to config.php such a line:%0a%0a $UploadBlacklist = array('.php', '.pl', '.cgi', '.py', '.shtm', '.phtm', '.pcgi', '.asp', '.jsp', '.sh');%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.48 (2013-02-11) [[#v2248]]%0aThis version fixes a bug introduced yesterday with some links. %0a%0a!! Version 2.2.47 (2013-02-10) [[#v2247]]%0aThis version enables tooltip titles in links to anchors in the same page, and the documentation was updated.%0a%0a!! Version 2.2.46 (2013-01-07) [[#v2246]]%0aThis version adds $UploadPermAdd and $UploadPermSet variables, and the documentation was updated.%0a%0aIf your wiki has uploads enabled, it is recommended to set the variable $UploadPermAdd to 0. %0a%0aThe $UploadPermAdd variable sets additional unix permissions applied to newly uploaded files, and should be 0 (recommended as of 2013). If uploaded files cannot be downloaded and displayed on the website, for example with the error 403 Forbidden, set this value to 0444 (core setting, default since 2004). %0a $UploadPermAdd = 0; # recommended%0a%0aThe $UploadPermSet variable unconditionally sets the file permissions on newly uploaded files. Only advanced administrators should use it.%0a%0a%0a!! Version 2.2.45 (2012-12-02) [[#v2245]]%0aThis version fixes some PHP notices appearing on some installations. The documentation was updated.%0a%0a!! Version 2.2.44 (2012-10-21) [[#v2244]]%0aThis version improves the display of consecutive whitespaces in page histories, and fixes the definition of PageTextVariables containing a dash. The documentation was updated.%0a%0a%0a!! Version 2.2.43 (2012-09-20) [[#v2243]]%0aThis version makes it possible to use HTML attribute names that contain dashes, and removes a warning when editing and previewing Site.EditForm. The documentation was updated.%0a%0a!! Version 2.2.42 (2012-08-20) [[#v2242]]%0aThis version provides a workaround for cases when a wiki page contains a character nonexistent in the active encoding. The documentation was updated.%0a%0a!! Version 2.2.41 (2012-08-12) [[#v2241]]%0aThis version changes the internal $KeepToken separator to be compatible with more encodings. The documentation was updated.%0a%0a!! Version 2.2.40 (2012-07-21) [[#v2240]]%0aThis version provides a helper function replacing htmlspecialchars() and compatible with PHP 5.4. The documentation was updated.%0a%0a!! Version 2.2.39 (2012-06-25) [[#v2239]]%0aThis version provides a fix for links to attachments containing international characters. The documentation was updated.%0a%0a!! Version 2.2.38 (2012-05-21) [[#v2238]]%0aThis version fixes a "parameter count" warning which appeared on some websites.%0a%0a!! Version 2.2.37 (2012-05-01) [[#v2237]]%0aThis version provides a workaround for installations with broken iconv() function, while optimizing the recode function. This should fix the "Unable to retrieve edit form" problem in some wikis. Dots in [[#anchor_1.2]] sections are now better supported, PageVariables are expanded in PageList template defaults, and the documentation is updated.%0a%0a!! Version 2.2.36 (2011-12-28) [[#v2236]]%0aThis version fixes the recode function to try to recover Windows-1252 characters in ISO-8859-1 files. A new variable $EnableOldCharset enables the $page["=oldcharset"] entry which will be used in the future. A couple of minor bugs were fixed and the documentation was updated.%0a%0a!! Version 2.2.35 (2011-11-11) [[#v2235]]%0aThis release fixes a critical PHP injection vulnerability, reported today by Egidio Romano. PmWiki versions 2.2.X, 2.1.X, 2.0.X and 2.0.beta33 and newer are vulnerable. When you upgrade, please read carefully the Release notes for all PmWiki versions since yours.%0a%0aIf you cannot upgrade, it is recommended to disable Searches at the earliest opportunity (even if your wiki skin doesn't have a search form). Add to config.php such a line:%0a if ($action == 'search') $action = 'browse';%0a%0aIf your old version wiki allows editing by not entirely trusted visitors, even on limited pages like a WikiSandbox, you should also disable PageLists. Add to config.php this line:%0a $EnablePageList = 0;%0a%0aThis version has an important change for international wikis: the XLPage() function no longer loads encoding scripts such as xlpage-utf-8.php. When you upgrade, you need to include those scripts from config.php, before calling XLPage():%0a%0a include_once("scripts/xlpage-utf-8.php"); # if your wiki uses UTF-8%0a XLPage('bg','PmWikiBg.XLPage');%0a%0aAll links can now have tooltip titles. Previously, only images and external links could have tooltip titles, now this feature is enabled for internal links. To set a tooltip title, add it in quotes after the link address:%0a[@%0a [[Main.HomePage"This is a tooltip title"]]%0a [[Main.HomePage"This is a tooltip title"|Home]]%0a [[http://www.pmwiki.org"Home of PmWiki"]]%0a Attach:image.jpg"Tooltip title of the image"%0a@]%0a%0aThe following new upload extensions were added: svg, xcf, ogg, flac, ogv, mp4, webm, odg, epub. A couple of minor optimizations were added (MarkupExpressions and rendering of page history) and the documentation was updated.%0a%0a!! Version 2.2.34 (2011-10-10) [[#v2234]]%0aThis version resets the timestamps of the default pages Site(Admin).AuthUser which are expected in case of upgrades from the versions 2.1.*. Core MarkupExpressions which manipulate strings should now work better with international characters. The documentation was updated to its latest state from pmwiki.org.%0a%0a!! Version 2.2.33 (2011-09-23) [[#v2233]]%0aThis version fixes a security bug introduced in 2.2.32 which left the groups Site and SiteAdmin open for reading and editing because the pages Site.GroupAttributes and SiteAdmin.GroupAttributes didn't have all necessary attributes. %0a%0aAll wikis running 2.2.32 should upgrade. If you cannot immediately upgrade, you can set the attributes from your wiki:%0a* open the attributes page [=[[SiteAdmin.GroupAttributes?action=attr]]=] and set a "read" and an "edit" password, @@ @lock @@ is recommended.%0a* open the attributes page [=[[Site.GroupAttributes?action=attr]]=] and set an "edit" password, @@ @lock @@ is recommended. Do not set a "read" password here.%0a%0aThe release also fixes the refcount.php script to produce valid HTML, and updates intermap.txt entries PITS: and Wikipedia: to point to their current locations.%0a%0a!! Version 2.2.32 (2011-09-18) [[#v2232]]%0aThis is the first version shipping with the core documentation in the UTF-8 encoding. PmWiki will automatically convert it on the fly for wikis using an older encoding.%0a%0aIt is recommended that all '''new''' PmWiki installations enable UTF-8. Migration of ''existing'' wikis from an older encoding to UTF-8 shouldn't be rushed: it is not trivial and will be documented in the future.%0a%0aA required HTML xmlns attribute was added to the print skin template. The history rendering is now faster when many lines are added or removed.%0a%0a%25note%25 Note: Due to a manipulation error, a version 2.2.31 was created before it was ready for a release.%0a%0a!! Version 2.2.30 (2011-08-13) [[#v2230]]%0aThis version fixes a $Charset definition in international iso-8859-*.php files. This will help for a future transition to UTF-8. %0a%0aA variable $EnableRangeMatchUTF8 was added, set it to 1 to enable range matches of pagenames in UTF-8 like [A-D]. Previously the range matches were always enabled in UTF-8, but we found out that on some installations this feature breaks all pagelists, even those without range matches. In case the feature worked for you, you can re-enable it.%0a%0a!! Version 2.2.29 (2011-07-24) [[#v2229]]%0aThis release fixes Attach links that were broken with the Path fix in 2.2.28 earlier today.%0a%0a!! Version 2.2.28 (2011-07-24) [[#v2228]]%0aThis release fixes 2 potential XSS vulnerabilities and a bug with Path: links.%0a%0a!! Version 2.2.27 (2011-06-19) [[#v2227]]%0aThis release fixes a validation bug on pages after a redirection. A new block WikiStyle [@%25justify%25@] was added, allowing left and right aligned text. The page history now accepts a URL parameter @@?nodiff=1@@ which hides the rendering of edit differences, showing only timestamps, authors, summaries and "Restore" links; it allows to restore a vandalized page with a huge contents or history which otherwise would break the memory or time limits of the server.%0a%0a!! Version 2.2.26 (2011-05-21) [[#v2226]]%0aThis release fixes a redundant removal of link hashes from WikiTrails, and updates the documentation to the most recent version from PmWiki.org.%0a%0a!! Version 2.2.25 (2011-03-22) [[#v2225]]%0aThis release only updates the documentation to the latest state on pmwiki.org.%0a%0a!! Version 2.2.24 (2011-02-15) [[#v2224]]%0aThis version reverts the way existing PageVariables are processed, like version 2.2.21 or earlier, but it adds a special variable $authpage which can be used in PageVar definitions. It is the same as the $page array, but exists only if the visitor has read permissions. For example, an administrator can set to config.php:%0a%0a $FmtPV['$LastModifiedSummary'] = '@$authpage["csum"]'; # instead of '@$page["csum"]'%0a%0aThen, the edit summary metadata will only be available if the user has read permissions.%0a%0a!! Version 2.2.23 (2011-01-25) [[#v2223]]%0aThis version sets the default value of $EnablePageVarAuth to 0 until we investigate a reported problem with authentication.%0a%0a!! Version 2.2.22 (2011-01-16) [[#v2222]]%0aThis version adds the variable $EnableXLPageScriptLoad which, if set to 0, will prevent authors to load scripts from XLPage and to accidentally change the encoding of the wiki. If you use it, make sure you include the required files, eg. xlpage-utf-8.php from local config files.%0a%0aPageVariables should now respect authentications: without read permissions, the title, description, change summary, author of a protected page are unavailable. PageVariables that are computed without reading the page are still available (eg. $Group, $Namespaced, $Version etc.). Administrators can revert the previous behavior by adding to config.php such a line:%0a%0a@@ $EnablePageVarAuth = 0; @@%0a%0a!! Version 2.2.21 (2010-12-14) [[#v2221]]%0aDue to a mis-configuration of a local svn repository, some of the changes intended for 2.2.20 didn't make it in the correct branch. This release corrects this.%0a%0a!! Version 2.2.20 (2010-12-14) [[#v2220]]%0aThis version fixes a potential XSS vulnerability, reported today. An AuthUser bug with excluding users from authgroups was fixed. A new InterMap prefix PmL10n: was added, it leads to the Localization section on PmWiki.org and should help the work of translators. A couple of other minor bugs were fixed and the documentation was updated.%0a%0a!! Version 2.2.19 (2010-11-10) [[#v2219]]%0aThis is a documentation-update release.%0a%0a!! Version 2.2.18 (2010-09-04) [[#v2218]]%0aThis version fixes 3 minor bugs, and updates the documentation.%0a%0a!! Version 2.2.17 (2010-06-20) [[#v2217]]%0aThis version adds a variable $PostConfig containing functions and scripts to be loaded after stdconfig.php. Tabindex was added as a valid form field attribute. Protected downloads now respect existing browser caches. AuthUser now allows more flexible cookbook recipe integration. A couple of bugs were fixed and the documentation was updated.%0a%0a!! Version 2.2.16 (2010-05-10) [[#v2216]]%0aThis version fixes a bug with parsing html attributes which could allow XSS injection. Wikis allowing unprotected editing are encouraged to upgrade.%0a%0aA bug with the "center" button of the GUI edit toolbar was corrected.%0a%0aThe "exists" conditional now accepts wildcards, for example:%0a [@(:if exists Main.*:)There are pages in the Main group (:if:)@]%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.15 (2010-03-27) [[#v2215]]%0aThis version adds some minor bugfixes and optimizations notably a bug with @@[=(:template none:)=]@@ introduced in the last version 2.2.14.%0a%0a!! Version 2.2.14 (2010-02-27) [[#v2214]]%0aThis release corrects inline styles for WikiTrail links. Undefined include/template @@ [={$$variables}=] @@ are now removed from the included section, like Page(Text)Variables, and can be used in conditional expressions. If needed, this change can be reverted by adding to config.php such a line:%0a%0a[@%0a $EnableUndefinedTemplateVars = 1; # keep and display unset {$$variables}%0a@]%0a%0aPageList templates now accept the sections @@ !first @@ and @@ !last @@ for markup to appear for every page in list ''except'' the first or last one.%0a%0a"Title" attributes were added to external links. You can have tooltip titles on external links, including InterMap and attachments, by adding the link title in double quotes after the URL:%0a [=[[http://www.pmwiki.org"Home of PmWiki"| External link]]=]%0a%0aFor international wikis, PmWiki now automatically translates the titles of technical pages like GroupAttributes or RecentChanges -- just define these strings as usual in XLPage, for example, in French:%0a 'AllRecentChanges' => 'Tous les changements récents',%0a%0aSome minor optimizations were done and the documentation was updated.%0a%0a!! Version 2.2.13 (2010-02-21) [[#v2213]]%0aThis release fixes a bug with $DiffKeepNum introduced in 2.2.10 -- the count of revisions was incorrect and a page could drop more revisions than it should.%0a%0aThe [[page history]] layout was modified with a rough consensus in the community. The history now defaults to "source" view with word-level highlighting of the differences. Authors can see the changes in rendered output by clicking on the link "Show changes to output". Admins can switch back the default by adding such a line to config.php:%0a%0a $DiffShow['source'] = (@$_REQUEST['source']=='y')?'y':'n';%0a%0aTo disable word-level highlighting and show plain text changes:%0a%0a $EnableDiffInline = 0;%0a%0aIn the page history rendering, a few minor bugs were fixed and the code was slightly optimized.%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.12 (2010-02-17) [[#v2212]]%0aThis release adds simple word-level highlighting of differences in the page history, when "Show changes to markup" is selected. To enable the feature, add to config.php such a line:%0a $EnableDiffInline = 1;%0a%0aThis feature is like what the InlineDiff recipe provides, but not exactly the same, and the implementation is simpler. It is enabled on PmWiki.org and can be improved -- your comments are welcome.%0a%0a!! Version 2.2.11 (2010-02-14) [[#v2211]]%0aThis release adds two new table directives for header cells, [=(:head:) and (:headnr:)=]. They work the same way as [=(:cell:) and (:cellnr:)=] except that create %3cth> instead of %3ctd> html tags.%0a%0aThe pagerev.php script was refactored into separate functions to allow easier integration of recipes displaying the page history.%0a%0aA couple of minor bugs were fixed and the documentation was updated.%0a%0a!! Version 2.2.9, 2.2.10 (2010-01-17) [[#v2210]]%0aMost important in this release is the official change of $EnableRelativePageVars to 1. The change is about how [={$Variable}=] in included pages is understood by PmWiki.%0a* When $EnableRelativePageVars is set to 0, [={$Name}=] displays the name of the currently browsed page. Even if [={$Name}=] is in an included page, it will display the name of the browsed page.%0a* When $EnableRelativePageVars is set to 1, [={$Name}=] displays the name of the physical page where it written. If [={$Name}=] is in an included page, it will display the name of the included page.%0a* [={*$Name}=] always displays the name of the currently browsed page, regardless of $EnableRelativePageVars.%0a%0aSo, if your wiki relies on page variables from included pages, and doesn't have $EnableRelativePageVars set to 1, after upgrading to 2.2.9, you can revert to the previous behavior by adding to config.php such a line:%0a $EnableRelativePageVars = 0;%0a%0aMore information about page variables can be found at:%0a http://www.pmwiki.org/wiki/PmWiki/PageVariables%0a%0aThis release adds a new variable $EnablePageTitlePriority which defines how to treat multiple [=(:title..:)=] directives. If set to 1, the first title directive will be used, and if a page defines a title, directives from included pages cannot override it. PmWiki default is 0, for years, the last title directive was used (it could come from an included page or GroupFooter).%0a%0aThis release also adds a new variable $DiffKeepNum, specifying the minimum number (default 20) of edits that will be kept even if some of them are older than the limit of $DiffKeepDays.%0a%0aA number of bugs were fixed and the documentation was updated.%0a%0a!! Version 2.2.8 (2009-12-07) [[#v228]]%0aThis release fixes another PHP 5.3 compatibility issue with conditional markup. The Author field now handles apostrophes correctly. The documentation was updated.%0a%0a!! Version 2.2.7 (2009-11-08) [[#v227]]%0aThis release fixes most PHP 5.3 compatibility issues. Unfortunately some specific builds for Windows may still have problems, which are unrelated to PmWiki. Notably, on Windows, all passwords need to be 4 characters or longer.%0a%0aUpload names with spaces are now correctly quoted. The documentation was updated.%0a%0a!! Version 2.2.6 (2009-10-04) [[#v226]]%0aWith this release it is now possible to display recently uploaded files to the RecentChanges pages -- if you have been using the RecentUploadsLog recipe, please uninstall it and follow the instructions at http://www.pmwiki.org/wiki/Cookbook/RecentUploadsLog.%0a%0aThe release also introduces $MakeUploadNamePatterns to allow custom filename normalization for attachements. It is now possible to replace $PageListFilters and $FPLTemplateFunctions with custom functions. Notify should now work in safe_mode. Some bugs were fixed, among which one with conditional markup with dates. The documentation was updated.%0a%0a!! Version 2.2.5 (2009-08-25) [[#v225]]%0aThis release adds a new markup for Pagelist templates, [@(:template none:)@] which allows a message to be set when the search found no pages. The FPLTemplate() function was broken into configurable sub-parts to allow development hooks. A number of bugs were fixed, and the documentation was updated.%0a%0a!! Version 2.2.4 (2009-07-16) [[#v224]]%0aThis release fixes a bug introduced earlier today with HTML entities in XLPages.%0a%0a!! Version 2.2.3 (2009-07-16) [[#v223]]%0aThis release fixes six potential XSS vulnerabilities, reported by Michael Engelke. The vulnerabilities may affect wikis open for editing and may allow the injection of external JavaScripts in their pages. Public open wikis should upgrade.%0a%0aA new variable $EnableUploadGroupAuth was added; if set to 1, it allows password-protected [[uploads]] to be checked against the Group password. %0a%0aIt is now possible to use @@ @_site_edit, @_site_read, @_site_admin@@ or @@ @_site_upload @@ global [[passwords]] in GroupAttributes pages.%0a%0aA number of other small bugs were fixed, and the documentation was updated.%0a%0a!! Version 2.2.2 (2009-06-21) [[#v222]]%0aThe major news in this release is a fix of an AuthUser vulnerability.%0a%0aThe vulnerability affects only wikis that (1) rely on the AuthUser core module %0afor User:Password authentication, -AND- (2) where the PHP installation runs %0awith the variable "magic_quotes_gpc" disabled.%0a%0aAll PmWiki 2.1.x versions from pmwiki-2.1.beta6 on, all 2.2.betaX, 2.2.0, and %0a2.2.1 are affected.%0a%0aThe PmWiki [[SiteAnalyzer]] can detect if your wiki needs to upgrade:%0a http://www.pmwiki.org/wiki/PmWiki/SiteAnalyzer%0a%0aIf your wiki is vulnerable, you should do one of the following at the earliest %0aopportunity:%0a%0a* Upgrade to a version of PmWiki at least 2.2.2 or greater.%0a* Turn on magic_quotes_gpc in the php.ini file or in a .htaccess file.%0a%0aAlternatively, you can temporarily disable AuthUser until you upgrade.%0a%0aNote that even if your wiki does not have the AuthUser vulnerability at the %0amoment, you are strongly encouraged to upgrade to PmWiki version 2.2.2 or %0alater, as some future configuration of your hosting server might put you at %0arisk.%0a%0aThis release also comes with minor updates in the local documentation; fixes %0awere applied for international wikis - notably global variables in %0axlpage-utf-8.php and a new variable $EnableNotifySubjectEncode, which allows %0ae-mail clients to correctly display the Subject header; and a number of other %0asmall bugs were fixed.%0a%0a!! Version 2.2.1 (2009-03-28) [[#v221]]%0aThis release comes with an updated local documentation; [[wiki trails]] now work cross-group; guiedit.php now produces valid HTML, and other small bugs were fixed. We also added $EnableRedirectQuiet, which allows redirects to take place without any mention of "redirected from page ....".%0a%0a!! Version 2.2.0 (2009-01-18) [[#v220]]%0a%0aThis is a summary of changes from 2.1.x to 2.2.0.%0a%0a* Several pages that were formerly in the [[Site]].* group are now in a separate [[SiteAdmin]].* group, which is read-restricted by default. The affected pages include Site.AuthUser, Site.AuthList, Site.NotifyList, Site.Blocklist, and Site.ApprovedUrls . If upgrading from an earlier version of PmWiki, PmWiki will prompt to automatically copy these pages to their new location if needed. If a site wishes to continue using the old Site.* group for these pages, simply set%0a%0a-> $SiteAdminGroup = $SiteGroup;%0a%0a-> when carrying out this upgrade inspect your config files for lines such as%0a--> $BlocklistDownload['Site.Blocklist-PmWiki'] = array('format' => 'pmwiki');%0a->as you may wish to fix then, eg%0a--> $BlocklistDownload[$SiteAdminGroup . '.Blocklist-PmWiki'] = array('format' => 'pmwiki');%0a%0a* Important Change in Passwords in PmWiki 2.2 indicating that the group can be edited even if a site password is set will be done by @@"@nopass"@@ prior it was done by @@"nopass"@@%0a-> When migrating a wiki you will have to manually modify the permission or by a script replace in all the page concerned @@passwdread=nopass:@@ by @@passwdread=@nopass@@ (see PITS:00961) --isidor%0a%0a* PmWiki now ships with WikiWords entirely disabled by default. To re-enable them, set either $LinkWikiWords or $EnableWikiWords to 1. To get the 2.1 behavior where WikiWords are spaced and parsed but don't form links, use the following:%0a-> $EnableWikiWords = 1;%0a-> $LinkWikiWords = 0;%0a%0a* It's now easy to disable the rule that causes lines with leading spaces to be treated as preformatted text -- simply set $EnableWSPre=0; to disable this rule.%0a%0a--> '''Important:''' There is ongoing discussion that the leading whitespace rule may be disabled ''by default'' in a future versions of PmWiki. If you want to make sure that the rule will continue to work in future upgrades, set $EnableWSPre=1; in ''local/config.php''.%0a%0a* The $ROSPatterns variable has changed somewhat -- replacement strings are no longer automatically passed through FmtPageName() prior to substitution (i.e., it must now be done explicitly).%0a%0a* Page variables and page links inside of [@(:include:)@] pages are now treated as relative to the included page, instead of the currently browsed page. In short, the idea is that links and page variables should be evaluated with respect to the page in which they are written, as opposed to the page in which they appear. This seems to be more in line with what authors expect. There are a number of important ramifications of this change:%0a%0a[[#relativeurls]]%0a** We now have a new [@{*$var}@] form of page variable, which always refers to "the currently displayed page". Pages such as Site.PageActions and Site.EditForm that are designed to work on "the currently browsed page" should generally switch to using [@{*$FullName}@] instead of [@{$FullName}@].%0a%0a** The $EnableRelativePageLinks and $EnableRelativePageVars settings control the treatment of links and page variables in included pages. However, to minimize disruption to existing sites, $EnableRelativePageVars defaults to '''disabled'''. This will give existing sites an opportunity to convert any absolute [@{$var}@] references to be [@{*$var}@] instead.%0a%0a** Eventually $EnableRelativePageVars will be enabled by default, so we highly recommend setting [@$EnableRelativePageVars = 1;@] in ''local/config.php'' to see how a site will react to the new interpretation. Administrators should especially check any customized versions of the following:%0a---> [[Site.PageActions]]%0a---> [[Site.EditForm]]%0a---> [[Site.PageNotFound]]%0a---> SideBar pages with ?action= links for the current page%0a---> $GroupHeaderFmt, $GroupFooterFmt%0a---> [[Page lists]] that refer to the current group or page, etc in sidebars, headers, and footers%0a%0a** The [@(:include:)@] directive now has a [@basepage=@] option whereby an author can explicitly specify the page upon which relative links and page variables should be based. If no basepage= option is specified, the included page is assumed to be the base.%0a%0a* Sites that want to retain the pre-2.2 behavior of [@(:include:)@] and other items can set [@$Transition['version'] = 2001900;@] to automatically retain the 2.1.x defaults.%0a%0a* Text inserted via [@(:include:)@] can contain "immediate substitutions" of the form [@{$$option}@] -- these are substituted with the value of any options provided to the include directive.%0a%0a* PmWiki now recognizes when it is being accessed via "https:" and switches its internal links appropriately. This can be overridden by explicitly setting $ScriptUrl and $PubDirUrl.%0a%0a* A new $EnableLinkPageRelative option allows PmWiki to generate relative urls for page links instead of absolute urls.%0a%0a* Draft handling capabilities have been greatly improved. When $EnableDrafts is set, then the "Save" button is relabeled to "Publish" and a "Save draft" button appears. In addition, an $EnablePublishAttr configuration variable adds a new "publish" authorization level to distinguish editing from publishing. See [[PmWiki:Drafts]] for more details.%0a%0a[[#ptvstart]]%0a* There is a new [@{$:var}@] "page text variable" available that is able to grab text excerpts out of markup content. For example, [@{SomePage$:Xyz}@] will be replaced by a definition of "Xyz" in SomePage. Page text variables can be defined using definition markup, a line beginning with the variable name and a colon, or a special directive form (that doesn't display anything on output):%0a%0a-->[@%0a:Xyz: some value # definition list form%0aXyz: some value # colon form%0a(:Xyz: some value:) # directive form%0a@]%0a[[#ptvend]]%0a%0a* The [@(:pagelist:)@] command can now filter pages based on the contents of page variables and/or page text variables. For example, the following directive displays only those pages that have an "Xyz" page text variable with "some value":%0a%0a-->[@(:pagelist $:Xyz="some value":)@]%0a%0a Wildcards also work here, thus the following pagelist command lists pages where the page's title starts with the letter "a":%0a%0a-->[@(:pagelist $Title=A* :)@]%0a%0a* The if= option to [@(:pagelist)@] can be used to filter pages based on conditional markup:%0a%0a-->[@(:pagelist if="auth upload {=$FullName}":)@] pages with upload permission%0a-->[@(:pagelist if="date today.. {=$Name}":)@] pages with names that are dates later than today%0a%0a* Spaces no longer separate wildcard patterns -- use commas. (Most people have been doing this already.)%0a%0a* Because page variables are now "relative", the [@{$PageCount}, {$GroupCount}, {$GroupPageCount}@] variables used in pagelist templates are now [@{$$PageCount}, {$$GroupCount}, {$$GroupPageCount}@].%0a%0a* One can now use [@{$$option}@] in a pagelist template to obtain the value of any 'option=' provided to the [@(:pagelist:)@] command.%0a%0a* The [@(:pagelist:)@] directive no longer accepts parameters from urls or forms by default. In order to have it accept such parameters (which was the default in 2.1 and earlier), add a [@request=1@] option to the [@(:pagelist:)@] directive.%0a%0a* The [@count=@] option to pagelists now accepts negative values to count from the end of the list. Thus [@count=5@] returns the the first five pages in the list, and [@count=-5@] returns the last five pages in the list. In addition, ranges of pages may be specified, as in [@count=10..19@] or [@count=-10..-5@].%0a%0a* Pagelist templates may have special [@(:template first ...:)@] and [@(:template last ...:)@] sections to specify output for the first or last page in the list or a group. There's also a [@(:template defaults ...:)@] to allow a template to specify default options.%0a%0a* PmWiki comes with an ability to cache the results of certain [@(:pagelist:)@] directives, to speed up processing on subsequent visits to the page. To enable this feature, set $PageListCacheDir to the name of a writable directory (e.g., ''work.d/'').%0a%0a* [[#elseifelse]]The [@(:if ...:)@] conditional markup now also understands [@(:elseif ...:)@] and [@(:else:)@]. In addition, markup can nest conditionals by placing digits after if/elseif/else, as in [@(:if1 ...)@], [@(:elseif1 ...:)@], [@(:else1:)@], etc.%0a%0a* The [@(:if date ...:)@] conditional markup can now perform date comparisons for dates other than the current date and time.%0a%0a* [[WikiTrails]] can now specify #anchor identifiers to use only sections of pages as a trail.%0a%0a* A new [@(:if ontrail ...:)@] condition allows testing if a page is listed on a trail.%0a%0a* The extensions .odt, .ods, and .odp (from OpenOffice.org) are now recognized as valid attachment types by default.%0a%0a* A new [[blocklist]] capability has been added to the core distribution. It allows blocking of posts based on IP address, phrase, or regular expression, and can also make use of publicly available standard blocklists. See [[PmWiki.Blocklist]] for details.%0a%0a* There is a new [[SiteAdmin.AuthList]] page that can display a summary of all password and permissions settings for pages on a site. This page is restricted to administrators by default.%0a%0a* There are new [@{$PasswdRead}@], [@{$PasswdEdit}@], etc. variables that display the current password settings for a page (assuming the browser has attr permissions or whatever permissions are set in $PasswdVarAuth).%0a%0a* Forms creation via the [@(:input:)@] markup has been internally refactored somewhat (and may still undergo some changes prior to 2.2.0 release). The new [@(:input select ...:)@] markup can be used to create select boxes, and [@(:input default ...:)@] can be used to set default control values, including for radio buttons and checkboxes.%0a%0a* The [@(:input textarea:)@] markup now can take values from other sources, including page text variables from other pages.%0a%0a* Specifying [@focus=1@] on an [@(:input:)@] control causes that control to receive the input focus when a page is loaded. If a page has multiple controls requesting the focus, then the first control with the lowest value of [@focus=@] "wins".%0a%0a* PmWiki now provides a ''scripts/creole.php'' module to enable Creole standard markup. To enable this, add [@include_once('scripts/creole.php')@] to a local customization file.%0a%0a* PmWiki adds a new [@{(...)}@] ''markup expression'' capability, which allows various simple string and data processing (e.g., formatting of dates and times). This is extensible so that recipe authors and system administrators can easily add custom expression operators.%0a%0a* It's now possible to configure PmWiki to automatically create Category pages whenever a page is saved with category links and the corresponding category doesn't already exist. Pages are created only if the author has appropriate write permissions into the group. To enable this behavior, add the following to ''local/config.php'':%0a%0a-->[@$AutoCreate['/^Category\\./'] = array('ctime' => $Now);@]%0a%0a* Sites with wikiwords enabled can now set $WikiWordCount['WikiWord'] to -1 to indicate that 'WikiWord' should not be spaced according to $SpaceWikiWords.%0a%0a* WikiWords that follow # or & are no longer treated as WikiWords.%0a%0a* Links to non-existent group home pages (e.g., [@[[Group.]]@] and [@[[Group/]]@]) will now go to the first valid entry of $PagePathFmt, instead of being hardcoded to "Group.Group". For example, to set PmWiki to default group home pages to [@$DefaultName@], use%0a%0a-->[@$PagePathFmt = array('{$Group}.$1', '$1.{$DefaultName}', '$1.$1');@]%0a%0a* PmWiki now provides a $CurrentTimeISO and $TimeISOFmt variables, for specifying dates in ISO format.%0a%0a* [[(Cookbook:)Cookbook]] authors can use the internal PmWiki function UpdatePage (temporarily documented at [[(Cookbook:)DebuggingForCookbookAuthors]]) to change page text while preserving history/diff information, updating page revision numbers, updating RecentChanges pages, sending email notifications, etc.%0a%0a* [[Skin templates]] are now required to have %3c!--HTMLHeader--> and %3c!--HTMLFooter--> directives. Setting $EnableSkinDiag causes PmWiki to return an error if this isn't the case for a loaded skin. Skins that explicitly do not want HTMLHeader or HTMLFooter sections can use %3c!--NoHTMLHeader--> and %3c!--NoHTMLFooter--> to suppress the warning.%0a%0a* Added a new "pre" wikistyle for preformatted text blocks.%0a%0a* The xlpage-utf-8.php script now understands how to space UTF-8 wikiwords. %0a%0a* Searches on utf-8 site are now case-insensitive for utf-8 characters.%0a%0a* Many Abort() calls now provide a link to pages on pmwiki.org that can explain the problem in more detail and provide troubleshooting assistance.%0a%0a* PmWiki no longer reports "?cannot acquire lockfile" if the visitor is simply browsing pages or performing other read-only actions.%0a%0a* The $EnableReadOnly configuration variable can be set to signal PmWiki that it is to run in "read-only" mode (e.g., for distribution on read-only media). Attempts to perform actions that write to the disk are either ignored or raise an error via Abort().%0a%0a* Including authuser.php no longer automatically calls ResolvePageName().%0a%0a* Authentication using Active Directory is now simplified. In Site.AuthUser or the $AuthUser variable, set "ldap://name.of.ad.server/" with no additional path information (see PmWiki.AuthUser for more details).%0a%0a* Pages are now saved with a "charset=" attribute to identify the character set in effect when the page was saved.%0a%0a* The phpdiff.php algorithm has been optimized to be smarter about finding smaller diffs.%0a%0a* Removed the (deprecated) "#wikileft h1" and "#wikileft h5" styles from the pmwiki default skin.%0a%0a* The mailposts.php and compat1x.php scripts have been removed from the distribution.%0a%0a----%0aBugs and other requests can be reported to the PmWiki Issue Tracking %0aSystem at http://www.pmwiki.org/wiki/PITS/PITS. Any help%0ain testing, development, and/or documentation is greatly appreciated.%0a%0a[[(PmWiki:)Release Notes archive]] - notes for versions older than 2.2.0.%0a -time=1723042397 +rev=842 +targets=PmWiki.Upgrades,PmWiki.ChangeLog,PmWiki.Download,PmWiki.RoadMap,PmWiki.BasicVariables,Site.EditForm,PmWiki.LayoutVariables,Cookbook.PmSyntax,PmWiki.UploadVariables,PmWiki.EditVariables,PmWiki.UploadsAdmin,PmWiki.ConditionalMarkup,Cookbook.DarkColorScheme,PmWiki.LinkVariables,PmWiki.OtherVariables,PmWiki.Notify,PmWiki.UrlApprovals,PmWiki.Functions,PmWiki.SecurityVariables,PmWiki.Forms,Cookbook.PmForm,PmWiki.PageLists,PmWiki.Tables,PmWiki.TableOfContents,PmWiki.AuthUser,PmWiki.WikiStyles,PmWiki.PageVariables,Cookbook.MarkupDirectiveFunctions,PmWiki.PagelistVariables,Cookbook.CustomSyntax,Cookbook.LocalTimes,Cookbook.RecentUploadsLog,Cookbook.DiffDelay,Cookbook.ReindexCategories,Cookbook.PageListMultiTargets,PITS.01095,PITS.01461,Cookbook.RecipeCheck,Skins.SkinChange,Cookbook.ToggleNext,PmWiki.Links,Cookbook.SectionEdit,PmWiki.BlockMarkup,Cookbook.DeObMail,Cookbook.FixURL,Cookbook.NotSavedWarning,Cookbook.EditHelp,Cookbook.AutoTOC,Cookbook.DeltaBytesRecentChanges,Cookbook.RowspanInSimpleTables,Cookbook.LocalCSS,Cookbook.PreviewChanges,PmWiki.MarkupExpressions,PmWiki.DebugVariables,PmWiki.WikiTrails,SiteAdmin.AuthList,PmWiki.PathVariables,Site.UploadQuickReference,PmWiki.Troubleshooting,PmWiki.CustomMarkup,PmWiki.PageDirectives,PmWiki.I18nVariables,PmWiki.PageHistory,PmWiki.Uploads,PmWiki.Passwords,PmWiki.SiteAnalyzer,Site.Site,SiteAdmin.SiteAdmin,PITS.00961,Site.PageActions,Site.PageNotFound,PmWiki.Drafts,PmWiki.Blocklist,Cookbook.Cookbook,Cookbook.DebuggingForCookbookAuthors,PmWiki.SkinTemplates,PmWiki.ReleaseNotesArchive +text=(:title Release Notes:)(:Summary: Notes about new versions, important for upgrades:)%0aSee also: [[Upgrades]], [[Change log]], [[(PmWiki:)Download]] and [[(PmWiki:)Road map]].%0a(:comment The {*$:Released} variable is used in [[News/]]. :)%0a%0a%0a!! Version 2.3.37 {*$:Released} (2024-08-21) [[#v2337]]%0a%0aThis version adds new variables $EnableCommonEnhancements and others, and updates docs/sample-config.php, to make it easier to enable some popular but optional functions, similar to what is enabled when editing on pmwiki.org.%0a%0aThe "minor checkbox" label is now part of the %25pmhlt%25[@(:input e_minorcheckbox:)@] markup, and may be modified automatically, notably when merging edits. Note that the page [[Site.EditForm]] has been modified, if you have customized it, you may want to edit this page and after [@(:input e_minorcheckbox:)@] remove the text "[@$[This is a minor edit]@]".%0a%0a$EnableSortable, and $EnableSimpleTableRowspan are now enabled by default. To disable them, set them to 0 in config.php.%0a%0aA new page variable %25pmhlt%25[@{$GroupHomePageUrl}@] contains the URL of the group homepage.%0a%0aMinor improvements to the pmwiki-responsive skin, to [[(Cookbook:)PmSyntax]], to in-page anchor tags, and the documentation was updated. [[ChangeLog|Full change log]].%0a%0a!! Version 2.3.36 {*$:Released} (2024-08-07) [[#v2336]]%0a%0aThis version introduces a drag-and-drop feature for uploads, which can be enabled using $EnableUploadDrop. The new $TROEPatterns array allows configuration of replace-on-edit patterns when a template is loaded onto an empty page. When a page is deleted, a history entry will now be recorded, capturing the timestamp, user, and change summary.%0a%0aThe release also includes a fix for PHP 8 and updated documentation.%0a%0a!! Version 2.3.35 {*$:Released} (2024-07-07) [[#v2335]]%0a%0aThis version updates links in the default sidebar to the HTTPS scheme, and places the links to PITS (issue tracking) and Mailing lists in a conditional for editors only.%0a%0aMinor improvements to PmSynxtax. It is now possible to show the source text of a wiki page highlighted by opening @@Page?action=source&highlight=1@@.%0a%0aA minor bug with escaped strings in page titles was fixed, and the documentation was updated.%0a%0aVersion 2.3.35 for security reasons removes the upload types "svg", "svgz", "htm", "html", "css", "swf", "fla", "epub". In some cases, those file formats may allow scripting and potentially open XSS vulnerabilities. Existing uploads with these extensions will not be affected. Wiki administrators who only allow trusted users to upload, can re-enable the extensions that they require with the following lines in config.php:%0a%0a%25hlt php%25[@%0a# NOTE: Only enable extensions that you require%0a%0a# files with no extension, the type may be auto-detected by the server%0a$UploadExts[''] = 'text/plain';%0a%0a# SVG images may contain scripting%0a$UploadExts['svg'] = 'image/svg+xml';%0a$UploadExts['svgz'] = 'image/svg+xml';%0a%0a# Epub may contain scripting and be opened by a browser extension%0a$UploadExts['epub'] = 'application/epub+zip';%0a%0a# Flash files may contain scripting on older browsers%0a# but are no longer supported by recent browsers%0a$UploadExts['swf'] = 'application/x-shockwave-flash';%0a$UploadExts['fla'] = 'application/vnd.adobe.fla';%0a%0a# HTML may contain scripting%0a$UploadExts['html'] = $UploadExts['htm'] = 'text/html';%0a%0a# CSS, if loaded by a browser, may request external resources%0a# and thus reveal your visitors to external websites%0a$UploadExts['css'] = 'text/css';%0a@]%0a%0aAdditionally, a few more upload extensions are considered for deprecation and removal from the core in early 2025. Please join the discussion: %0a https://www.pmwiki.org/wiki/PITS/01509.%0a%0a%0a!! Version 2.3.34 {*$:Released} (2024-05-27) [[#v2334]]%0a%0aThis version adds a new [[conditional markup]] for the current wiki action like %25pmhlt%25[@(:if action browse,edit:)@] which accepts comma-separated actions and wildcards. A new [[UploadsAdmin|upload extension]] "m4a" for audio files was added. A few updates for recent PHP versions, minor improvements for RecipeCheck and $GUIButtons, some cleanup and the documentation was updated.%0a%0a%0a!! Version 2.3.33 {*$:Released} (2024-04-21) [[#v2333]]%0a%0aThis version includes updates for PHP 8, improvements to the responsive skin, to the preview changes mode, to conditional markup handling, and the documentation was updated. PmSyntax will now colorize links in double brackets. A new variable $HTMLTitleFmt in local configuration can override the format between %25hlt html%25[@%3ctitle>...%3c/title>@] defined in a skin template.%0a%0a%0a!! Version 2.3.32 {*$:Released} (2024-03-24) [[#v2332]]%0a%0aThis version includes improvements for the dark color scheme, restoring a light scheme for printing.%0a%0aPictures with a white background may appear too bright on a dark theme, so a new variable $ImgDarkSuffix, when defined, allows you to prepare a separate picture adapted for the dark theme. On a wiki page you still use @@[=Attach:picture.png=]@@ and when the dark theme is loaded, the browser will load @@[=Attach:=]picture'''-dark'''.png@@ (if it exists).%0a%0aNew image and upload extensions AVIF and AVIFS were added, FileSizeCompact() was refactored to allow decimal file sizes, Recent changes pages will be locked to prevent blanking in case of concurrent uploads, and the documentation was updated.%0a%0a%0a!! Version 2.3.31 {*$:Released} (2024-02-23) [[#v2331]]%0a%0aThis release includes improvements to the color sets of the dark theme for the PmWiki-responsive skin, and for the PmSyntax highlighting. The dark toggle icons are now 3-state, rotating between Light, Dark, and Auto (browser/system preference), and an annotation tooltip near the icon displays the current mode. The dark theme functions detecting, storing, and restoring visitor preferences can be reused by other skins, and a new variable $EnableDarkThemeToggle can define the default theme for visitors that have not used the toggle icon.%0a%0aThe page attributes form where passwords and permissions are defined, can now add or remove passwords, users, or groups, without the need to rewrite the full definition. If for example you need to add a new password and a group without removing existing permissions, type "[@+ @]" (plus, space) or "[@- @]" (minus, space), followed by the permissions to be added or removed:%0a + MyNewPassword @newgroup%0a%0aEdit templates entries can now include page patterns where the template should be used. For example:%0a $EditTemplatesFmt[] = "Site.TalkTemplate name=*-Talk";%0a%0aThe function PrintFmt() was refactored to process markup and wiki pages before outputting HTML headers, which would allow for markup, headers, footers, sidebars included from the skin, and action pages like the Auth form, to configure $HTMLHeaderFmt and $HTMLStylesFmt, and the directives %25pmhlt%25@@[=(:noheader:), (:notitle:), (:noleft:), (:noaction:)=]@@%25%25 to work from these pages. In case your wiki relied on the previous behavior, you can revert to it by adding to config.php:%0a $EnablePrePrintFmt = 0;%0a%0aThe variable $EnableUploadVersions can now be set to 2, and if a file with the same name already exists, the new file will have a unique suffix added. %0a%0aRecipeCheck was updated to also list skins and report their versions.%0a%0aOther minor changes include: the "form" attribute was added to input fields; WikiStyles accept a new property 'columns', %25pmhlt%25@@[=(:redirect quiet=1:)=]@@%25%25 has been refactored to prevent an infinite loop, and the documentation was updated.%0a%0a%0a!! Version 2.3.30 {*$:Released} (2024-01-22) [[#v2330]]%0a%0aPublishing my 176th PmWiki release, this milestone coincides with 15.0 years of me (Petko) serving as core developer. Here are some new developments that may be interesting.%0a%0a'''Dark color theme''': The PmWiki-responsive skin has new styles for a user-activated dark/night scheme, with dark backgrounds and light texts. A dark theme can be softer on the eyes if used at night or in dark rooms. %0a%0aAn icon to toggle the styles is placed near the search box in the header. It is possible to place toggle icons and/or labels in wiki pages, headers, footers, sidebars, to toggle stylesheets, and all functions can be easily reused in other skins, and with syntax highlighting, see Cookbook:DarkColorScheme.%0a%0a'''PmSyntax''': We added styles for the new dark color theme. These may be improved in the future.%0a%0a'''PmWiki logo''': A new logo in SVG format was added to pub/skins/pmwiki, and the variable $PageLogoUrl was updated to use the new logo by default. A vector logo can upscale without pixelizing or blurring and looks better on the dark theme. Most wikis have their own logos, this will not change, but if you prefer to display the old raster logo, add to config.php such lines:%0a%0a%25hlt php%25[@%0a$FarmPubDirUrl = $PubDirUrl; # if not already defined%0a$PageLogoUrl = "$FarmPubDirUrl/skins/pmwiki/pmwiki-32.gif"%0a@]%0a%0a'''Page history''': A significant improvement in the word-diff highlighting precision.%0a%0a'''Uploads''': Various fixes for $EnableUploadMimeMatch and Attach: links with escaped filenames.%0a%0a'''Forms''': The input field %25pmhlt%25[@(:input e_author:)@] is now available to all forms with pre-filled author name and "required" attribute per $EnablePostAuthorRequired. A positional form action URL no longer needs to be quoted.%0a%0a'''Quiet redirects''': With the directive %25pmhlt%25[@(:redirect OtherPage:)@], the variable $EnableRedirectQuiet can now be set to 2 to make all redirects quiet by default (without @@quiet=1@@ argument), unless there is a @@quiet=0@@ argument. Quiet redirects will now prevent multiple jumps and infinite loop errors (like normal redirects).%0a%0aThe release includes a few other minor fixes and the documentation was updated.%0a%0a!! Version 2.3.29 {*$:Released} (2023-12-18) [[#v2329]]%0a%0aThis version includes a fix for PHP 8.2 and improvements to the PmSyntax functions, markup directives defined in $MarkupDirectiveFunctions now accept dashes in attribute names, and the documentation was updated.%0a%0a%0a!! Version 2.3.28 {*$:Released} (2023-11-27) [[#v2328]]%0a%0aThis version adds new form input types "month" and "color".%0a%0aA new variable $NotifyRelatedTrailFmt allows for the Notify trail= function to automatically include related pages when the base page is in the trail. This has been enabled on PmWiki.org, so if your notify trail contains Cookbook.MyRecipe, you will be notified about edits to this page, but also to Cookbook.MyRecipe-Talk and Cookbook.MyRecipe-Users.%0a%0aThe "simpletable" zebra backgrounds are now reversed when the table has a %3cthead> element, in order to have dark-light-dark rows instead of dark-dark-light.%0a%0aWith [[UrlApprovals]], if a URL with the insecure http: scheme has been approved, URLs with the secure https: scheme to the same domain name will be automatically approved (not the other way around).%0a%0aSome utility JavaScript functions should now work better when localStorage is not available.%0a%0aThe documentation was updated.%0a%0a%0a!! Version 2.3.27 {*$:Released} (2023-10-23) [[#v2327]]%0a%0aThis version includes fixes for PHP 8, and for time formats with an invalid timezone. %0a%0aWhen merging the last edit without an edit summary, it will now reuse the previous edit summary.%0a%0aThe ".diffmarkup" element now has the style "white-space: pre-wrap" - if a custom skin disables core styles you may want to update the skin styles.%0a%0aWhen $EnableEditAutoText is enabled, new keyboard shortcuts will be available: %25pmhlt%25@@[=Ctrl+B ('''bold'''), Ctrl+I (''italic''), Ctrl+K ([[link]]/unlink).=]@@%0a%0aThe documentation was updated.%0a%0a%0a!! Version 2.3.26 {*$:Released} (2023-09-28) [[#v2326]]%0a%0aThis version includes updates for PHP 8.2, customizable HTML snippets for trails and input labels. It is now possible to configure searching for "at least one" term among many, as opposed to currently searching for all terms. Extensions are now removed from the $UploadExts array if their size is set to zero in $UploadExtSize, and the documentation was updated.%0a%0a%0a!! Version 2.3.25 {*$:Released} (2023-07-29) [[#v2325]]%0a%0aThis version includes updates for PHP 8.2. Some core markup directives were refactored to prevent very rare bugs. The documentation was updated.%0a%0a%0a!! Version 2.3.24 {*$:Released} (2023-06-06) [[#v2324]]%0a%0aThis version includes some code refactoring, and a new helper function [[Functions#InsertEditFunction|InsertEditFunction()]] to simplify the reuse of core functionality by recipes. %0a%0aIt is now possible to configure the merging of the latest edits by the same author into a single history entry, see $EnableMergeLastMinorEdit.%0a%0aNew configuration variables $AuthFormRespCode, $EnableUploadMimeMatch, $EnableDownloadRanges, see documentation.%0a%0aPmForm now can validate an email address field with the "template require FIELD if=validemail" condition.%0a%0aA few other minor improvements in the [[change log]], and the documentation was updated.%0a%0a%0a!! Version 2.3.23 {*$:Released} (2023-05-03) [[#v2323]]%0aThis version implements session tokens to prevent potential cross-site request forgery vulnerabilities, suggested by Dominique Faure. Most core actions that modify pages or files should have this enabled and should work like before. %0a%0aThis new feature can be disabled by setting these variables in config.php:%0a%0a%25hlt php%25[@%0a $EnablePmToken = 0; # edit, upload, attributes, approveurls%0a $PmFormEnablePmToken = 0; # PmForm%0a@]%0a%0aSome installations might encounter the error message "Token invalid or missing". These can include custom edit forms, automated scripts posting to the wiki, AJAX posting text or uploads used by some recipes, or partial upgrades where some core scripts haven't been updated. Most of these should be easy to update -- please check if you're using the latest recipe versions, otherwise report such cases to us -- otherwise you may selectively disable the feature. See [[Upgrades#pmtoken]].%0a%0aA [[Forms|form]] element %25pmhlt%25[@(:input pmtoken:)@] was added, and the helper function [[Functions#pmtoken|pmtoken()]] was documented to make it easy for custom forms and recipes to use this new feature.%0a%0aThe version also includes a minor code refactoring, a bug fix, and the documentation was updated.%0a%0a%0a!! Version 2.3.22 {*$:Released} (2023-04-06) [[#v2322]]%0aThis version adds to the core the Cookbook:PmForm recipe (script and templates), not enabled by default. This is in order to reduce my workload, and future updates to PmForm will be made only in the core version. %0a%0aIf you already use PmForm, you can enable the core script, by modifying your @@include_once()@@ call from "@@'''cookbook'''/pmform.php@@" to "@@'''scripts'''/pmform.php@@". Your existing templates and configuration should continue to work.%0a%0aA bug was fixed with [[PageLists]] with multiple @@category=+A,+B@@ categories. Input [[forms]] and buttons can now be configured to ask for confirmation before they are submitted. A few updates for recent PHP versions, and other minor improvements, and the documentation was updated.%0a%0a!! Version 2.3.21 {*$:Released} (2023-03-06) [[#v2321]]%0aThis version includes updates for PHP 8, and bug fixes with [[tables#sortable|sortable tables]] and multiline $MarkupDirectiveFunctions. The core [[table of contents]] was updated to work better with recent SectionEdit versions, and the documentation was updated.%0a%0aNew features include: the upload extension CSV, $EnableLocalTimes with a new short mode 3 where old dates are shown as MM'YY, and a new variable $EnableCopyCode to add [@[+]@] buttons for easy copying of preformatted blocks.%0a%0a!! Version 2.3.20 {*$:Released} (2023-02-12) [[#v2320]]%0aThis version fixes an unidentified variable warning introduced yesterday in 2.3.19.%0a%0a!! Version 2.3.19 {*$:Released} (2023-02-11) [[#v2319]]%0aThis version includes fixes for recent PHP versions, new helper functions, new variables allowing more customization, and the documentation was updated.%0a%0aWork is underway to define and implement a new family of self-contained recipes "Modules" which should be easier to install, configure and update. It may be possible to easily update your modules and skins either from a remote Git/SVN repository, or by simply dropping a ZIP file into the "modules" directory, and use a wiki-based editor to enable and configure them. Nothing will change for existing recipes, and they will not need to be updated; this will be an entirely optional new interface. Let me know if you can suggest features/scopes added to the wishlist.%0a%0aPmWiki too may be able to run directly from the read-only release ZIP archive, without the need to unzip it first. Again, this will be entirely optional, the current ways will continue to work as before, and slightly faster than the ZIP version (approx. 2%25 faster in my benchmarks).%0a%0a%0a!! Version 2.3.18 {*$:Released} (2023-01-15) [[#v2318]]%0a%0aThis version fixes a bug with user groups in with conditional markup, includes updates for PHP 8, minor improvements to the edit textarea and to the syntax highlighting. A helper function pm_json_encode() was added for servers where the PHP-JSON extension is not enabled.%0a%0aThe documentation was updated.%0a%0a!! Version 2.3.17 {*$:Released} (2022-12-17) [[#v2317]]%0a%0aThis release has updates for recent PHP versions.%0a%0aThe edit textarea had some improvements. Edit buttons and the automatic edit text will now insert their wiki markup in a way which allows for the "undo" function in the text area to work (with Ctrl+Z). The edit textarea (with $EnableEditAutoText enabled) now accepts 4 new keyboard shortcuts: Ctrl+L and Ctrl+Shift+L to convert the selected text to lowercase or uppercase, and Ctrl+Shift+ArrowUp or ArrowDown to move the line with the cursor up or down.%0a%0aA new variable $EnableBaseNameConfig was added - it allows to enable automatic inclusion of local configuration for the "basename" of the current page, for example Group.Page-Draft to include local/Group.Page.php if it exists.%0a%0aConditional markup %25pmhlt%25[@(:if auth @admins,@editors:)@] can now check if the current user belongs to selected usergroups (with [[AuthUser]]).%0a%0aA few minor bugs and omissions were fixed, and the documentation was updated.%0a%0a!! Version 2.3.16 {*$:Released} (2022-11-28) [[#v2316]]%0a%0aThis version fixes a bug with some skins introduced in 2.3.15 last week, and reverts PrePrintFmt(). %0a%0aNew WikiStyles 'notoc' and 'overflow' were added. PmTOC Table of contents, and the list of included pages in the edit form, now use classnames instead of style attributes.%0a%0aPmSyntax fixes a font-size alignment bug with nested programming languages, and has been optimized for large pages.%0a%0aA few more minor bugs were fixed, including for PHP 8, and the documentation was updated.%0a%0a%0a!! Version 2.3.15 {*$:Released} (2022-11-21) [[#v2315]]%0a%0aSecurity: Closed a potential XSS vulnerability discovered today. Your wiki may be at risk if untrusted people can edit your pages.%0a%0aHTTP headers: CSP updated, XSSP added. Both can be disabled or modified by changing the $HTTPHeaders values.%0a%0aCookies: Added a new variable $CookieSameSite default to 'Lax' per current browser defaults and expectations. Updated pmsetcookie() added an argument $samesite, and refactored to work with old and current PHP versions. Added function pm_session_start() as a replacement for session_start() with respect for local preferences ($CookieSameSite, $EnableCookieSecure, $EnableCookieHTTPOnly). %0a%0a[[Cookbook:PmSyntax|PmSyntax]]: A new CSS variable @@--pmsyntax-fontsize-editform@@ allows to set the font size of the edit form separately from highlighted elements in the documentation. Fixed the [@[[Highlight]]@] label could change fonts when clicked.%0a%0aResponsive skin: The font size for "pre" and "code" elements is now scalable/relative to the paragraph font size rather than fixed. This works better in headings or small text blocks.%0a%0aGUI edit buttons: Part of these functions were rewritten to avoid 'unsafe inline' JavaScript. While default and most custom buttons should work without change, you should no longer need to url-encode some characters like %25 or add backslashes. If you have such buttons, you may need to update their declarations to strip the extra backslashes. %0a%0a[[WikiStyles]]: Refactored to move all inline WikiStyles to the $HTMLStylesFmt array in the header of the HTML page.%0a%0aTables and block markup: Replaced inline @@style="..."@@ attributes with class names. %0a%0aThe function PrintFmt() was refactored to process skin parts, skin functions, markup, and wiki pages, before sending the HTTP and HTML headers. This allows for wikistyles and recipes in sidebars and footers to add their configuration to the headers.%0a%0aIf you have questions or difficulties upgrading, please contact us.%0a%0a!! Version 2.3.14 {*$:Released} (2022-11-03) [[#v2314]]%0a%0aThis version includes fixes for recent PHP versions and for 2 minor bugs (searchbox wrongly encoded entities and %25pmhlt%25[@{(ftime %25L)}@] format). Inline JavaScript for focusing form fields is now replaced with native attributes. In the Edit form, the "Minor edit" label can now toggle the checkbox.%0a%0aThe "disabled obsolete markup" tooltip now includes the file path and the line number of the markup rule definition.%0a%0aPmSyntax now recognizes %25pmhlt%25[@(:template requires? ...:)@] which is used by some recipes.%0a%0aThe documentation was updated.%0a%0a!! Version 2.3.13 {*$:Released} (2022-10-07) [[#v2313]]%0aThis version closes a potential XSS vulnerability, reported by lukystreik. A new variable $FailedLoginsFunction will allow to define a function limiting the number of failed logins. The documentation was updated.%0a%0a!! Version 2.3.12 {*$:Released} (2022-09-25) [[#v2312]]%0aThis version has a few fixes for PHP8. Complex conditionals with empty page variables could cause errors, now fixed. Form elements with values like "0" could appear empty, now fixed. The PSFT() function and the %25pmhlt%25[@{(ftime)}@] markup expression now recognize a "%25L" format as a human-readable localizable timestamp. A new helper function PrintAuthForm() was split from PmWikiAuth() to allow recipes to call it directly. The documentation was updated.%0a%0a!! Version 2.3.11 {*$:Released} (2022-08-30) [[#v2311]]%0a%0aThis version fixes the function stripmagic(), when used with arrays (a recent update for PHP 8 broke it).%0a%0aNew [[PageVariables]] derived from a Group's homepage are now available: %25pmhlt%25 [@{$GroupHomePage}@], [@{$GroupHomePageName}@], [@{$GroupHomePageTitle}@], [@{$GroupHomePageTitlespaced}@].%0a%0aA new helper function should simplify recipes with custom markup directives of the format:%0a%0a-> %25pmhlt%25 [@(:mydirective arg=val param="other value":)...(:mydirectiveend:)@].%0a%0aSee the documentation at Cookbook:MarkupDirectiveFunctions.%0a%0aThe core documentation was updated.%0a%0a%0a!! Version 2.3.10 {*$:Released} (2022-08-20) [[#v2310]]%0a%0aThis version includes updates for PHP 8. Wildcard $DefaultUnsetPageTextVars should now work with forms. PmSyntax fixed text alignment between the edit area and the colored block in some cases. The documentation was updated.%0a%0a!! Version 2.3.9 {*$:Released} (2022-08-18) [[#v239]]%0a%0aThis version includes updates for PHP 8. Non-wildcard $DefaultUnsetPageTextVars should now work with %25pmhlt%25[@(:input default:)@]. PmSyntax now handles blocks with simpler selectors, possibly created by recipes. The documentation was updated.%0a%0a!! Version 2.3.8 {*$:Released} (2022-07-22) [[#v238]]%0a%0aThis version fixes a bug caused by a recent update for PHP 8 with the include markup:%0a%0a %25pmhlt%25[@(:include Page1 Page2 Page3:)@]%0a%0aWhen the first page doesn't exist, it didn't check for the other pages (now fixed).%0a%0aIn addition, PmSyntax was improved when more than one inline blocks are on the same line, and the documentation was updated.%0a%0a%0a!! Version 2.3.7 {*$:Released} (2022-06-28) [[#v237]]%0a%0aThis version sets default HTTP headers X-Frame-Options (reported by Imagine Dragon) and Content-Security-Policy to disallow embedding in external websites by default and clickjacking attempts.%0a%0aShould you require the previous behavior, you can add this line to local/config.php:%0a%0a-> %25hlt php%25[@unset($HTTPHeaders['XFO'], $HTTPHeaders['CSP']);@]%0a%0a$EnableHighlight will now remember any links to PmWiki variables and restore them after the highlighting. %0a%0a$EnablePmSyntax will now process %25pmhlt%25[@%25hlt pmwiki%25@] in addition to [@%25pmhlt%25@] blocks, and escaped markup after it will be tentatively highlighted.%0a%0aThe documentation was updated.%0a%0a%0a!! Version 2.3.6 {*$:Released} (2022-06-19) [[#v236]]%0a%0aThis version contains fixes for PHP 8. A form attribute "lang" was added. %0a%0aSortable tables now allow for table headers to have markup such as bold (except links), and will use a case-insensitive natural ordering. %0a%0aSearchbox now has a default placeholder %25pmhlt%25 [@"$[Search]"@] and can have the submit button removed with the argument [@label=""@] (users need to press Enter on their keyboards to search).%0a%0a$EnableHighlight-formatted code blocks are now converted to plain text to prevent warnings; there is an ongoing discussion in the mailing list so this solution may evolve.%0a%0aFor developers: $UploadVerifyFunction can now modify $upname, and a variable $PageIndexTermsFunction can configure a replacement function for PageIndexTerms().%0a%0aThe documentation was updated.%0a%0a%0a!!Version 2.3.5 {*$:Released} (2022-05-23) [[#v235]]%0a%0aThis version fixes a bug with %25pmhlt%25 @@[=(:pagelist list=grouphomes:)=]@@. A new helper function DisableSkinParts() allows for simpler disabling of headers, footers and sidebars from recipes. When a file is uploaded, new variables with the file path and URL are now available to recipes.%0a%0aThe version also contains fixes for PHP 8 and documentation updates.%0a%0a%0a!!Version 2.3.4 {*$:Released} (2022-04-22) [[#v234]]%0a%0aThis version includes fixes for PHP 8 and documentation updates.%0a%0a%0a!!Version 2.3.3 {*$:Released} (2022-03-26) [[#v233]]%0a%0aThis version includes fixes for PHP 8 and documentation updates.%0a%0a%0a!!Version 2.3.2 {*$:Released} (2022-02-09) [[#v232]]%0a%0aThis version includes bug fixes and updates for PHP 8.1. The core variable $EnableIncludedPages introduced in 2.3.0 was renamed to $EnableListIncludedPages to avoid ambiguity. With LocalTimes, is now possible to configure the number of days the "plus" button will pull from the page history, and the function will better recognize some older RecentUploads formats. PmSyntax was updated so that "%25pmhlt%25@@\\@@" line breaks in tables and headings are treated like in the core, staying in the same context; and the different PmSyntax blocks will now be processed in parallel.%0a%0aThe code configuring and loading pmwiki-utils.js was moved to a new file scripts/utils.php, and a new variable $EnablePmUtils was added to allow administrators to easily disable these functions. The script pmwiki-utils.js will now be included in the page header rather than the footer, which may reduce the number of page redraws. The individual functions will now be processed in parallel.%0a%0aThe documentation was updated.%0a%0a%0a!!Version 2.3.1 {*$:Released} (2022-01-15) [[#v231]]%0a%0aThere was an omission in the release script which unexpectedly deleted the $VersionNum variable which broke some settings. This quick release fixes it.%0a%0a!!Version 2.3.0 {*$:Released} (2022-01-15) [[#v230]]%0a%0aJanuary 2022 is the 20th year anniversary of the release of PmWiki version 0.1, and 13 years since I (Petko) became core developer. This merited additional work and effort with hopefully interesting and useful new production.%0a%0a'''PHP 5.3 - 8.1 compatibility''' %0a* PmWiki 2.3.0 includes updates for PHP 8.0 and 8.1.%0a* Consequently, it requires PHP version 5.3 (released 2009) or more recent.%0a%0a'''PmSyntax'''. A new function PmSyntax was added to the core, and enabled on pmwiki.org. %0a* It highlights PmWiki syntax in the documentation, and possibly in the basic edit form. %0a* It only highlights PmWiki markup, and is independent from Highlight.js. See Cookbook:PmSyntax and $EnablePmSyntax. %0a* It should highlight most core language features and those of many recipes, see [[https://www.pmwiki.org/wiki/Test/PmSyntax|this mashup of various markups]]. %0a* Developers can add custom rules in the $CustomSyntax array, see Cookbook:CustomSyntax. %0a* The %25pmhlt%25 [@(:markup:)@] directive can now have @@class=norender@@ to only show the source code without processing it. This may be useful, together with PmSyntax, in 2 cases: writing/discussing markup code without actually running it, or working on PageList Templates where you want to see and edit them highlighted.%0a%0a'''Improvements to the edit form'''%0a* PmSyntax (above) can be enabled to highlight the PmWiki markup the edit form, and should work in recent standards-compliant browsers.%0a* The variable $EnableNotSavedWarning is now enabled by default. Add to config.php @@$EnableNotSavedWarning = 0;@@ to disable it.%0a* A new variable {- $EnableIncludedPages -} $EnableListIncludedPages (from 2.3.2) allows listing of other pages included from the currently edited page, with links to see or edit them. When the variable is enabled, the list of pages appears in the edit form, after the text area, in a collapsed %3cdetails> element. The list includes pages from which text, text variables, or templates are included from the edited page. This is enabled on pmwiki.org if you wish to preview it.%0a* The $EnableEditAutoText function will now feel more like other text editors by removing the automatically inserted bullet when Enter is pressed twice.%0a%0a'''Dates and times, monitoring, review'''%0a* The %25pmhlt%25 [@{(ftime)}@] Markup expression now accepts a new format '[@%25o@]' for the ordinal suffix of the date.%0a* The [[Notify]] feature now accepts a @@tz=@@ timezone specifier for individual subscribers. See [[Notify#tz]].%0a* A function based on Cookbook:LocalTimes was added to the core. See [[Cookbook:LocalTimes|the recipe page]] for the differences. You can continue using the recipe, or disable it and enable the core function.%0a* New core variables $EnableLocalTimes, $CurrentLocalTime.%0a* New markup %25pmhlt%25[@@2022-01-09T08:35:00Z@]%25%25 output as a %3ctime> element, formatted via $TimeFmt; localized if $EnableLocalTimes. %0a* Added a variable $EnableRecentUploads which makes it easy to enable the Recent Uploads feature on AllRecentChanges. This is a basic format that may be good enough for many wikis. For more options, see Cookbook:RecentUploadsLog.%0a* The default $RecentChangesFmt now use the variable $CurrentLocalTime instead of $CurrentTime. In the wiki source text it saves the timestamps in a portable time format in GMT, which is then shown formatted per $TimeFmt (wiki timezone). It looks just like $CurrentTime did previously, but can be converted to the visitor's time zone if LocalTimes is enabled. If you have custom $RecentChangesFmt entries that use $CurrentTime, nothing will change for you, but you may want to update these with $CurrentLocalTime if you want to benefit from localization.%0a* The "page history" page now has CSS classes for the delay between edits: diffday, diffweek, diffmonth, diffyear. These allow styling of vertical spacing between individual edits in page histories. See Cookbook:DiffDelay for an example.%0a* The page history can now have a "hidden" edit type, in addition to "minor". This is intended to be used by recipes in order to hide, rather than delete, some edits from the page history. A couple of new recipes using this feature will be added in the next few days.%0a%0a'''PageLists, categories, backlinks'''%0a* [[PageLists]] now accept a new argument @@category=Name@@ which lists only pages declared in the category with the markup %25pmhlt%25 [@[[!Name]]@], and does not include pages simply linking to [@[[Category/Name]]@] (unless they also contain [@[[!Name]]@]).%0a** The differentiation between links to !Name and Category.Name requires the pages containing category links to be re-indexed; see Cookbook:ReindexCategories which can automate this.%0a* Also in PageLists, the arguments @@link=@@ and @@category=@@ now accept multiple and negative specifiers, and wildcards. See [[PageLists#wildcards]]. If you previously used the recipe Cookbook:PageListMultiTargets, please disable it when you upgrade to 2.3.0.%0a* Category links can now have a different text, like %25pmhlt%25 [@[[!Name|Text]]@], and the markup generally behaves like other links, see PITS:01095.%0a%0a'''Styles''' (core skin PmWiki-responsive)%0a* Collapsible sections details+summary will now change the cursor to the "pointer" style over the clickable element, and the color will change to "navy". %0a* The core table of contents function ($PmTOC) has had its styles updated, in order to properly indent long sub-headings.%0a%0a'''Core helper functions'''%0a* A new helper function %25hlt php%25@@PSFT()@@ can now be used as an ''almost'' drop-in replacement for @@strftime()@@ and @@gmstrftime()@@ which became deprecated in PHP 8.1. Please review the documentation at [[Functions#PSFT]]. If you have local configurations or recipes using @@strftime()@@ you can change for @@PSFT()@@ now.%0a* A helper function %25hlt php%25@@DownloadUrl($pagename, $path)@@ was added, see [[Functions#DownloadUrl]]. It can simplify the handling of attached files by recipes.%0a%0aLast but not least, '''the documentation''' in English has been updated with the latest development (and in German by MFWolff).%0a%0aSee also [[Upgrades#v22v23|Upgrading from version 2.2.145 to 2.3.0]].%0a%0aAs always, if you have any questions or difficulties, please let us know.%0a%0a%0a!! Version 2.2.145 {*$:Released} (2021-12-11) [[#v22145]]%0aThis version includes a minor change in search patterns: searches and pagelists with a wrong or undefined $SearchPatterns (@@list=abc@@ argument) will now use $SearchPatterns["default"] rather than an empty array (effectively all pages). This was likely the intended behavior, a way for admins to restrict search locations.%0a%0aIt also includes updates for PHP 8, a fix of an emoji for non-UTF8 wikis, and the latest pages of the documentation.%0a%0a!! Version 2.2.144 {*$:Released} (2021-11-06) [[#v22144]]%0aThis version includes fixes for PHP 8 and an update to @@intermap.txt@@. The conditional markup "exists" was optimized when called multiple times. The functions %25hlt php%25@@CondExists()@@, @@MatchPageNames()@@, and @@MatchNames()@@, can now be called with an additional argument (false) when a case-sensitive match is needed. The documentation was updated.%0a%0a!! Version 2.2.143 {*$:Released} (2021-10-02) [[#v22143]]%0aThis version should prevent some errors from local customization or recipes with recent PHP versions, by disabling obsolete markup rules and replacement patterns. If such markup appears on a page, it will not be processed, it will be rendered like this: %25frame%25@@⚠(:my-obsolete-directive params:)@@%25%25 and a tooltip title should have some additional information.%0a%0aCare should be taken if you have custom calls to the deprecated function [[PmWiki/Functions#PCCF|%25hlt php%25@@PCCF()@@]], and incompatible custom replacement patterns processed via [[PmWiki/Functions#PPRE|@@PPRE()@@]] or [[PmWiki/Functions#PPRA|@@PPRA()@@]] are silently skipped, which may not work as expected. (Previously they wouldn't work at all.)%0a%0aIf you experience any difficulties, please do let us know and we'll try to provide a fix.%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.142 {*$:Released} (2021-08-31) [[#v22142]]%0aThis version hides some PHP 8 notices, and adds 2 new form element attributes "accept" and "autofocus". %0a%0aThe documentation was updated.%0a%0a%0a!! Version 2.2.141 {*$:Released} (2021-07-09) [[#v22141]]%0aThis version adds ways to define 2 custom functions:%0a* $MultiFactorAuthFunction to enable custom MFA/2FA with [[AuthUser]]%0a* $PageIndexFoldFunction to define a custom function normalizing the page terms while indexing and searching (by default PmWiki converts the terms to lowercase).%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.140 {*$:Released} (2021-06-26) [[#v22140]]%0aThis version has updates for PHP 8. %0a%0aThe API of the source code highlighting library has changed and the PmWiki loader function was adapted; if you use this feature, please upgrade Highlight.js to version 11.0.0 or newer. %0a%0aNote: since version 11, Highlight.js doesn't preserve HTML in the preformatted blocks and issues a console warning, so you should only use the [@(space)[=escaped=]@] or the @@[=[@escaped@]=]@@ markup blocks.%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.139 {*$:Released} (2021-05-05) [[#v22139]]%0aThis version removes empty "title" attributes in HTML tags (links and images), fixes warnings which appear with PHP 8 and updates the documentation.%0a%0a!! Version 2.2.138 {*$:Released} (2021-03-02) [[#v22138]]%0aThis version fixes a bug when a details directive has markup in the summary attribute, and the documentation was updated.%0a%0a!! Version 2.2.137 {*$:Released} (2021-02-26) [[#v22137]]%0aThis version fixes a bug introduced earlier today with entities encoded twice in PQA() quoted arguments.%0a%0a!! Version 2.2.136 {*$:Released} (2021-02-26) [[#v22136]]%0aThis version fixes a XSS vulnerability for WikiStyles reported today by Igor Sak-Sakovskiy.%0a%0aThe fix adds a second argument $keep to the core function PQA($attr, $keep=true) which by default escapes HTML special characters and places the values in Keep() containers. If you have custom functions that call PQA() and expect the previous behavior, call PQA() with a second argument set to false.%0a%0aIf you have any questions or difficulties, please let us know.%0a%0a!! Version 2.2.135 {*$:Released} (2021-01-31) [[#v22135]]%0aThis version fixes a number of PHP8 compatibility issues. This is a work in progress, if you uncover others, please report them at PITS:01461.%0a%0aA work is underway to implement session tokens to prevent CSRF vulnerabilities -- suggested by Dominique Faure. I wanted to rework these functions but the PHP8 compatibilities are more urgent so at the moment the PmToken functions are transparent/non-functional.%0a%0aA defunct syndicated blocklist was disabled, a minor code refactoring was done for PmTOC to better support manual edit section links, and the documentation was updated.%0a%0a%0a!! Version 2.2.134 {*$:Released} (2020-11-30) [[#v22134]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.133 {*$:Released} (2020-10-25) [[#v22133]]%0aThis version fixes a potential vulnerability to CWE-384: Session Fixation, reported by Dominique Faure. The fix regenerates the session identifier at the moment someone logs in. In case this is not desirable, a wiki admin can set the new variable $EnableAuthPostRegenerateSID to false.%0a%0aThis version also fixes an unintended variable evaluation in link markups. The CSS from Cookbook:RecipeCheck will now be injected only when needed. The responsive skin styles contained a reduced padding value for numbered and bulleted lists in order to save space, but in longer lists it could clip the item numbers. This value was removed from the styles because it was complex to reliably override it from local configuration. If you need to enable the previous values, add to pub/css/local.css the following:%0a%0a%25hlt css%25[@%0aul, ol { padding: 0 0 0 20px; }%0a@media screen and (min-width:50em) {%0a ul, ol { padding: 0 0 0 40px; }%0a}@]%0a%0a!! Version 2.2.132 {*$:Released} (2020-09-30) [[#v22132]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.131 {*$:Released} (2020-08-30) [[#v22131]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.130 {*$:Released} (2020-07-04) [[#v22130]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.129 {*$:Released} (2020-05-21) [[#v22129]]%0aThis version adds the styles for the "simpletable" class of tables from the "pmwiki-responsive" skin into the old "pmwiki" skin, and the documentation was updated.%0a%0a!! Version 2.2.128 {*$:Released} (2020-04-26) [[#v22128]]%0aThis version only includes some cosmetic changes and updates the documentation.%0a%0a!! Version 2.2.127 {*$:Released} (2020-03-23) [[#v22127]]%0aThis version sets the maximum height of the edit form textarea after reports for a jumping behavior on mobile devices (the PmWiki-responsive skin only). The core table of content classes "pmtoc-show" and "pmtoc-hide" now replace the previous classes "show" and "hide" to prevent conflicts with other frameworks. The functionality of the recipe Skins:SkinChange was added to the core (disabled by default). The documentation was updated.%0a%0a!! Version 2.2.126 {*$:Released} (2020-02-01) [[#v22126]]%0aThis version fixes a bug with $PmTOC['MinNumber'] set to -1, and updates the .htaccess format for caches.php. The documentation was updated.%0a%0a!! Version 2.2.124, 2.2.125 {*$:Released} (2020-01-27) [[#v22125]]%0aThis version adds a variable $SetCookieFunction to override the core "pmsetcookie" function. A new feature ToggleNext was included in the core, documented at Cookbook:ToggleNext. The documentation was updated.%0a%0a!! Version 2.2.123 {*$:Released} (2019-12-31) [[#v22123]]%0aThis version allows link URLs to be [[Links#escaped | escaped]] with [@[=link address=]@] if they contain any special characters, including quotes, parentheses and pipes. The obfuscated e-mails will now work from headers, footers and sidebars. A [[forms|form]] attribute "formnovalidate" was added to the core and to the "Cancel" button in the edit form. Core [[table of contents]] will now work better with Cookbook:SectionEdit. Cookbook:RecipeCheck was included in the core -- if you have this recipe already installed, you can simply comment it out from your config.php. The code that handles $EnableRCDiffBytes was refactored to also show the bytes changed in the page histories. New upload extensions [[https://developers.google.com/speed/webp | "webp"]] (images) and [[https://www.opus-codec.org/ | "opus"]] (audio) were added. The documentation was updated.%0a%0a!! Version 2.2.122 {*$:Released} (2019-11-19) [[#v22122]]%0aVersion 2.2.121 was released by mistake and contained some experimental code that was meant to be tested first. %0a%0aThis version fixes a bug with ObfuscateLinkIMap() and international characters. New configuration variables $DefaultUnsetPageTextVars, $DefaultEmptyPageTextVars can set default values for page text variables. The built-in table of contents and numbered headings can now be enabled independently. A pagelist template pseudovariable [@{$$EachCount}@] was added, containing the number of the page in the current "each" loop. Input form elements and the [@(:searchbox:)@] field now can have ARIA accessibility attributes.%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.120 {*$:Released} (2019-10-13) [[#v22120]]%0aThis version fixes a bug with existing complex customization of GUIEdit buttons. Very long [[table of contents|tables of contents]] will now be scrollable. A new "input datalist" [[Forms|form]] element (list of suggestions to other input fields), and a new "details+summary" [[block markup|block section]] (toggle sections without JavaScript) were added. The documentation was updated.%0a%0a!! Version 2.2.119 {*$:Released} (2019-10-03) [[#v22119]]%0aThis version updates the core for PHP 7.4. Required input fields now feature @@required="required"@@ attributes and modern browsers prevent sending the edit or upload form with empty required fields. Attachlist @@ext=@@ and @@names=@@ arguments now accept patterns and negatives like @@ext=jpg,png@@, @@ext=-pdf@@, or @@names=-th*---*.jpg@@. The Redirect function can now have a 3rd argument with the full URL. The scroll position in the edit text area will be remembered on save-and-edit and preview. A bug was fixed with pagelist while preview. The documentation was updated.%0a%0aA number of features currently provided by recipes were added to the core and disabled by default. You can still use the recipes, or you can disable them and enable the core features. The following features were added:%0a* e-mail obfuscation functions based on Cookbook:DeObMail; see instructions to enable%0a* a FixUrl button based on Cookbook:FixURL, see $EnableGuiEditFixUrl%0a* $EnableNotSavedWarning based on Cookbook:NotSavedWarning%0a* $EnableEditAutoText based on Cookbook:EditHelp%0a* $PmTOC, [@(:toc:)@], [@(:notoc:)@], Table of contents/Numbered headings, based on a simplified variant of Cookbook:AutoTOC%0a* $EnableSortable, basic sortable tables%0a* $EnableRCDiffBytes based on Cookbook:DeltaBytesRecentChanges%0a* $EnableSimpleTableRowspan replicating the markup from Cookbook:RowspanInSimpleTables%0a* $WikiPageCSSFmt enables CSS in a wiki page, based on Cookbook:LocalCSS%0a* $EnableHighlight code highlight feature compatible with "highlight.js"%0a* $AddLinkCSS['othergroup'] and $AddLinkCSS['samedomain'] can contain custom CSS classes for in-wiki links to other groups and for URL links to the same site.%0a%0aThe above new features are disabled by default, see the documentation for more information on how to enable them, or test them on pmwiki.org where most of these are enabled. Please report if you notice any problems.%0a%0a!! Version 2.2.118 {*$:Released} (2019-08-28) [[#v22118]]%0aThis version integrates the features of the recipe Cookbook:PreviewChanges into the core. If you currently use this recipe, please uninstall it and add to config.php:%0a $EnablePreviewChanges = 1;%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.117 {*$:Released} (2019-07-28) [[#v22117]]%0aThis version adds handling of "partial content" requests for file downloads. New video file extensions 'm4v' and '3gp' were added. The Upload form now includes a new text field "Uploader" pre-filled with the name of the editor, and a new variable $EnableUploadAuthorRequired was added (defaults to $EnablePostAuthorRequired). The documentation was updated.%0a%0a!! Version 2.2.116 {*$:Released} (2019-06-19) [[#v22116]]%0aThis version fixes pagelists with case insensitive matches of page (text) variables for international wikis. If your international wiki pagelists rely on case-sensitive variable matches, please see $PageListVarFoldFn. The documentation was updated.%0a%0a!! Version 2.2.115 {*$:Released} (2019-05-13) [[#v22115]]%0aIn this version the responsive skin in large "desktop" mode changes the search form background to transparent, for easier custom styling of the header. The documentation was updated.%0a%0a!! Version 2.2.114 {*$:Released} (2019-04-02) [[#v22114]]%0aThis version adds a skin directive @@%3c!--IncludeTemplate ... -->@@ and the variable $SkinTemplateIncludeLevel. The core variable documentation format identifiers were moved to the definition term element to allow CSS ":target" styling, and the header and link text of the vardoc table can now be translated. Input forms have a new HTML5 element "tel", a new attribute "pattern" and two bugs were fixed with the classnames of the new elements and with the identifiers of "select" lists. The documentation was updated.%0a%0a!! Version 2.2.113 {*$:Released} (2019-03-01) [[#v22113]]%0aThis version adds a new [@(:input button:)@] form element. All form elements can now accept custom data-* attributes, which can be disabled by setting $EnableInputDataAttr to 0. Both additions are meant for easier integration with custom JavaScript functions or some frameworks.%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.112 {*$:Released} (2019-01-09) [[#v22112]]%0aThis version includes a fix for PHP 7.3, and the documentation was updated.%0a%0a!! Version 2.2.111 {*$:Released} (2018-12-08) [[#v22111]]%0aThis version updates core .htaccess files to be compatible with both Apache 2.4 and earlier versions, and the variable $DenyHtaccessContent was added with the updated content. In case of difficulties or questions please contact us.%0a%0aA CSS value in the pmwiki-responsive skin was fixed. The [[MarkupExpression(s)]] [@{(ftime )}@] now accepts @@tz=@@ (time zone) and @@locale=@@ (language locale) arguments. The documentation was updated.%0a%0a!! Version 2.2.110 {*$:Released} (2018-11-05) [[#v22110]]%0aThis version prevents a warning with the [@{(substr )}@] markup expression when non-number arguments are typed. A new variable $PageListSortCmpFunction allows custom functions to order page lists. A new variable $MarkupMarkupLevel indicates when the processing happens inside [@(:markup:)@] blocks. %0a%0aThe default style for @@[=[@escaped code@]=]@@ dropped white spaces inconsistently and was fixed. If you rely on the previous behavior please add this to your pub/css/local.css file to revert it:%0a%0a code.escaped { white-space: nowrap; }%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.109 {*$:Released} (2018-07-09) [[#v22109]]%0aThis version fixes a bug with the Path: InterMap prefix which was broken in 2.2.108. The function pmcrypt() was updated to prevent more strings from causing "invalid hash" warnings in PHP 7. The variable $EnableMarkupDiag was added to help diagnose all markup calls. The documentation was updated.%0a%0a!! Version 2.2.108 {*$:Released} (2018-07-05) [[#v22108]]%0aThis version adds the $PCCFOverrideFunction variable allowing a custom function to override PCCF(). $AuthUserPageFmt can now be an array of page names. The page cache file name can now be customized. Form checkbox labels now have the same tooltip title as the checkbox. Ordered lists with the [@%25reversed%25@] WikiStyle will have descending numbers. Minor fixes to refcount.php, vardoc.php, and pmcrypt(). The default InterMap PmWiki URLs have now the HTTPS protocol. The documentation was updated.%0a%0a!! Version 2.2.107 {*$:Released} (2018-02-02) [[#v22107]]%0aThis version includes more fixes for PHP 7.2 for forms and pagelists. A new variable $MailFunction allows administrators and developers to write replacement functions for the PHP function "mail()". Styles were improved for right-to-left text blocks embedded into left-to-right texts (and vice versa). The documentation was updated.%0a%0a!! Version 2.2.106 {*$:Released} (2017-12-01) [[#v22106]]%0aThis version has a rewrite of the function PageListSort() to allow it to work with PHP 7.2, and fixes a bug with the backtick (escape) [@`WikiWord@] markup. The helper function pmsetcookie() and the variables $EnableCookieSecure, $EnableCookieHTTPOnly were added to allow easy setting of secure cookies. The documentation was updated.%0a%0a!! Version 2.2.105 {*$:Released} (2017-11-07) [[#v22105]]%0aThis version fixes a bug with the PQA() function causing invalid HTML with attributes glued together. The function @@HandleUpload()@@ was refactored and @@UploadSetVars($pagename)@@ was added to allow upload-managing add-ons to set variables more easily.%0a%0aIf you upgrade from 2.2.98 or earlier, and you have custom markup rules relative to author signatures, please see note about [[#v2299|change in 2.2.99]] (documented November 2017).%0a%0a!! Version 2.2.104 {*$:Released} (2017-10-11) [[#v22104]]%0aThis version fixes a bug with [[WikiTrails#pathtrail|path WikiTrails]] reported today.%0a%0a!! Version 2.2.103 {*$:Released} (2017-10-01) [[#v22103]]%0aThis 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.%0a%0aPagelists 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.%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.102 {*$:Released} (2017-08-05) [[#v22102]]%0aThis version reverts the patterns for text variables changed in 2.2.99, because we found that a longer text variable content may cause a blank page or an internal server error. In the page [[SiteAdmin.AuthList]] an input box was added to allow filtering of the groups or pages.%0a%0a!! Version 2.2.101 {*$:Released} (2017-07-30) [[#v22101]]%0aThis version renames the internal constructor of the PageStore class to be compatible with both PHP 5 and PHP 7. Previously, the PageStore class had two constructors for PHP 4 and PHP 5 compatibility of which one was silently ignored, but recent PHP 7 versions display strict or deprecated notices when the PHP 4 constructor is used.%0a%0aIf you must use PmWiki 2.2.101 or newer on a PHP 4 installation, please contact me so I can provide you with a workaround.%0a%0a!! Version 2.2.100 {*$:Released} (2017-07-30) [[#v22100]]%0aThis version provides a workaround for an incompatibility with our Subversion version control system, where the $Author wiki variable was considered a Subversion variable. A fix for the responsive skin adds some spacing above the WikiText block. The documentation was updated.%0a%0a!! Version 2.2.99 {*$:Released} (2017-06-26) [[#v2299]]%0aThis version fixes a bug where an incomplete text variable without a closing parenthesis like "[@(:Var:Value@]" could hide the remaining of the page.%0a%0aA bug was fixed where previewing a page didn't show changes to be done by replace-on-save patterns (the function ReplaceOnSave was refactored). Markup rules for previewing author signatures are no longer needed and were removed. %25note%25 Note that if you had custom markup rules processed before or after the @@[=~~=][=~=]@@ or @@[=~~=][=~~=]@@ author signatures may need to be set to [@'%3c[[~'@] (second argument of the @@Markup@@ call).%0a%0aA bug and a warning for PHP 4 installations were fixed. Two minor bugs with the [@[[%3c%3c]]@] line break for the responsive skin and the $Version variable link in the documentation were fixed. %0a%0aThe InterMap prefix to Wikipedia was corrected to use the secure HTTPS protocol and the documentation was updated.%0a%0a!! Version 2.2.98 (2017-05-31) [[#v2298]]%0aThis version adds a new skin that is better adaptable to both large and small screens, desktop and mobile devices (touchscreens). The new skin "pmwiki-responsive" is not enabled by default but available as an option, and as a base for customized copies. It requires a relatively modern browser (post-2009). The old skin is still available and enabled by default.%0a%0aThe Vardoc links now use MakeLink() to allow a custom LinkPage function. The function ReplaceOnSave() was refactored to allow easier calling from recipes. Markup processing functions now can access besides $pagename, a $markupid variable that contains the "name" of the processed markup rule, allowing a single function to process multiple markup rules. The "*.mkv" video extension was added to the list of allowed uploads.%0a%0aA bug was fixed with the [@(:markup:)@] output where a leading space was lost. Note that the "markup" frame is now wrapped in a %3cpre> block with a "pre-wrap" style instead of %3ccode>.%0a%0aA number of other (minor) bugs were fixed: see ChangeLog, and the documentation was updated.%0a%0a!! Version 2.2.97 (2017-04-07) [[#v2297]]%0aThis version fixes a bug concerning $ScriptUrl when $EnablePathInfo is set, introduced in 2.2.96 and reported by 3 users.%0a%0a!! Version 2.2.96 (2017-04-05) [[#v2296]]%0aThis version fixes a severe PHP code injection vulnerability, reported by Gabriel Margiani. PmWiki versions 2.2.56 to 2.2.95 are concerned.%0a%0aOnly certain local customizations enable the vulnerability. Your website may be at risk if your local configuration or recipes call too early some core functions like CondAuth(), RetrievePageName() or FmtPageName(), before the $pagename variable is sanitized by ResolvePageName() in stdconfig.php. A specific URL launched by a malicious visitor may trigger the vulnerability.%0a%0aMost recipes call core functions from a $HandleActions function, or from a Markup expression rule, these do not appear to be affected by the current exploit.%0a%0aIf your wiki may be at risk, it is recommended to upgrade to version 2.2.96 or most recent at the earliest opportunity. If you cannot immediately upgrade, you should place the following line in your local (farm)config.php file:%0a%0a [@$pagename = preg_replace('![${}\'"\\\\]+!', '', $pagename);@]%0a%0aPlace this line near the top of the file but after you include scripts/xlpage-utf-8.php or other character encoding file.%0a%0aThis version filters the $pagename variable to exclude certain characters. A new variable $pagename_unfiltered is added in case a recipe requires the previous behavior. The documentation was updated.%0a%0a!! Version 2.2.95 (2017-02-28) [[#v2295]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.94 (2017-01-31) [[#v2294]]%0aThis version allows webmasters to configure and use both .html and .htm extensions. The cached information about whether a page exists or not will now be cleared when that page is created or deleted. The documentation was updated.%0a%0a!! Version 2.2.93 (2016-12-31) [[#v2293]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.92 (2016-11-30) [[#v2292]]%0aThis version allows administrators to disable the "nopass" password by setting $AllowPassword to false. The function FmtPageName() will now expand PageVariables with asterisks like [@{*$FullName}@]. The documentation was updated.%0a%0a!! Version 2.2.91 (2016-09-30) [[#v2291]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.90 (2016-08-31) [[#v2290]]%0aThis version adds a parameter to the upload form which can improve analytics from the server logs. Two new CSS classes were added to help skin developers: @@imgonly@@ and @@imgcaption@@, for standalone embedded pictures with or without a caption. A bug with the plus-links was fixed. The documentation was updated.%0a%0a!! Version 2.2.89 (2016-07-30) [[#v2289]]%0aThis version allows to set a default class name for simple tables. The [@(:searchbox:)@] directive can now have a "placeholder" attribute, and the input type can be changed from "text" to "search" for HTML5 websites. The edit form elements have now identifier attributes to allow easier styling. All core scripts will now inject CSS into the skin only if it hasn't already been defined. The vardoc.php script now recognizes and links to the documentation for the variables $pagename, $Author and $Skin. The documentation was updated.%0a%0a!! Version 2.2.88 (2016-06-29) [[#v2288]]%0aThis version fixes invalid HTML output of some WikiTrail links. The function PHSC() can now have an optional fourth argument for a safe replacement of htmlspecialchars(). A new page variable [@{$SiteAdminGroup}@] was added and the documentation was updated. %0a%0a!! Version 2.2.87 (2016-05-31) [[#v2287]]%0aThis version adds the $HTMLTagAttr variable to be used in the %3chtml> tag in skins for additional attributes like "lang" or "manifest". To enable it, use it in your skin, for example:%0a%0a %3chtml xmlns="http://www.w3.org/1999/xhtml" $HTMLTagAttr>%0a%0aThe variable $EnableRevUserAgent, if set to 1, will cause the User-Agent string from browsers to be stored with each page history entry (as opposed to only storing the last user agent string). The output variable $DiffUserAgent can be used in history templates like $DiffStartFmt.%0a%0aA wrong page variable in [[Site.UploadQuickReference]] was corrected, and the documentation was updated.%0a%0a!! Version 2.2.86 (2016-04-28) [[#v2286]]%0aThis version adds updates for PHP 7, for the PageStore() class and for the $DefaultPasswords default/unset definitions (no action should be needed upon upgrades). The documentation was updated.%0a%0a!! Version 2.2.85 (2016-03-31) [[#v2285]]%0aThis version adds Scalable Vector Graphics (*.svg, *.svgz) as allowed uploads and as embeddable picture extensions (with the html tag %3cimg/>). The documentation was updated.%0a%0a!! Version 2.2.84 (2016-02-21) [[#v2284]]%0aThis version fixes "indent" and "outdent" styles for right-to-left languages. A new variable $EnableLinkPlusTitlespaced allows "plus links" [@[[Link|+]]@] to display the "Spaced Title" of the page instead the "Title". The documentation was updated.%0a%0a!! Version 2.2.83 (2015-12-31) [[#v2283]]%0aThis is a documentation update version.%0a%0a!! Version 2.2.82 (2015-11-30) [[#v2282]]%0aThis version enables stripmagic() to process arrays recursively and updates the documentation.%0a%0a!! Version 2.2.81 (2015-10-31) [[#v2281]]%0aThis version fixes an inconsistency with single line page text variables. International wikis enabling UTF-8 will now be able to use the CSS classes "rtl" and "ltr" to override the text direction when inserting right to left languages. The documentation was updated.%0a%0a!! Version 2.2.80 (2015-09-30) [[#v2280]]%0aThis version modifies the [@(:searchbox:)@] directive to use type="search" semantic input, and updates the documentation.%0a%0a!! Version 2.2.79 (2015-08-27) [[#v2279]]%0aThis version adds WikiStyles for the CSS basic colors "fuchsia", "olive", "lime", "teal", "aqua", "orange" and "gray"/"grey". New input elements "email", "url", "number", "date", and "search" can now be used in wiki forms. %0a%0aNote: the "target" attribute of input forms which was added in the previous version broke the PmForm processor, and was removed until we find a solution. If you don't use PmForm and require this attribute (or others), the usual way to add it is to redefine the $InputAttrs array in your local configuration.%0a%0aA new variable $EnableROSEscape can be set to 1 if $ROSPatterns and $ROEPatterns should not process source text wrapped with [@[=...=]@] or @@[=[@...@]=]@@. By default "replace on edit" patterns are performed even in such text.%0a%0aThe insMarkup() function in guiedit.js was refactored to allow custom input ids and/or custom functions to process the selected text.%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.78 (2015-07-21) [[#v2278]]%0aThis version updates the $RobotPattern list with currently active user agents. {-Input forms can have a "target" attribute-} (removed in 2.2.79). The documentation was updated.%0a%0aNote, this release broke the Cookbook:PmForm module. Please do upgrade to 2.2.79 or newer if your wiki uses PmForm.%0a%0a!! Version 2.2.77 (2015-06-19) [[#v2277]]%0aThis version extends the [@(:if attachments:)@] conditional to specify file and page names. A [@{$WikiTitle}@] page variable was added. A MatchNames() function was introduced as a generic way to match array values the same way MatchPageNames() does currently with lists of pages -- recipe authors can use it to get a subset of attachments for example. The PageStore() class was slightly optimized when recoding pages from-to UTF-8. The documentation was updated.%0a%0a!! Version 2.2.76 (2015-05-31) [[#v2276]]%0aThis version improves support for arrays in form elements: setting default values and recovering values from posted forms. A new "label" argument to checkbox and radio input elements allows easy insertion of clickable text labels after the form elements. Division blocks wrapping standalone images, and standalone image captions, now receive CSS classes allowing greater control via stylesheets. The documentation was updated.%0a%0a!! Version 2.2.75 (2015-04-26) [[#v2275]]%0aThis version adds a pmcrypt($pass, $salt) function which can be used as a replacement for the PHP crypt() function when encrypting passwords. From PHP 5.6 on, crypt() should not be used without a $salt parameter and would raise a notice. If pmcrypt() is called with a $salt parameter it will simply call crypt() in order to check a password. If it is called without a $salt parameter, pmcrypt() will create a password hash with the password_hash() function or with crypt() depending on your installation. You can replace any calls to crypt() with pmcrypt(), notably in config.php when defining $DefaultPasswords entries.%0a%0aMarkup was added for the semantic HTML5 tags article, section, nav, header, footer, aside, address.%0a%0aA bug with the uploads feature was fixed when $EnableReadOnly is set, and the documentation was updated.%0a%0a!! Version 2.2.74 (2015-03-28) [[#v2274]]%0aThis version allows the translation of the word "OK" in authentication forms. The documentation was updated to the latest state on pmwiki.org.%0a%0a!! Version 2.2.73 (2015-02-28) [[#v2273]]%0aThis release only updates the documentation to the latest state on pmwiki.org.%0a%0a!! Version 2.2.72 (2015-01-27) [[#v2272]]%0aThis version improves the ?action=ruleset display for markup rules potentially incompatible with PHP 5.5 when the function debug_backtrace() is not available. It restores the ability to set a custom function handling the [=(:markup:)=] demos. A variable $AbortFunction was added allowing administrators to override the core Abort() function. The documentation was updated.%0a%0a!! Version 2.2.71 (2014-12-29) [[#v2271]]%0aThis version removes the hard word wrap in [@(:markup:)@] wikicode examples, and instead of %3cpre> tags, it wraps it in %3ccode> tags. This allows newcomers to copy and paste the code in their wikis without inserted line breaks (which often cause the markup to not work).%0a%0aThe release also adds back-tracing for markup rules potentially incompatible with PHP 5.5. Such rules, often added by recipes, can trigger "Deprecated: preg_replace()" warnings. To find out which recipes may trigger the warnings, enable diagnostic tools in config.php with @@$EnableDiag = 1;@@ then open a page with the 'ruleset' action, eg. [@[[HomePage?action=ruleset]]@]. The PHP-5.5-incompatible rules will be flagged with filenames, line numbers and patterns. See also the pages [[(PmWiki:)Troubleshooting]] and [[(PmWiki:)CustomMarkup]] on pmwiki.org.%0a%0aThe variable $DraftActionsPattern was added, the pagelist "request" parameter can now contain a list of allowed or disallowed parameters that can be overridden by the user, the "input default source" parameter can now contain multiple pages, and a minor bug was fixed in upload.php ('strict' warning). See the updated documentation for more information. %0a%0a!! Version 2.2.70 (2014-11-08) [[#v2270]]%0aThis release only updates the documentation to the latest state on pmwiki.org.%0a%0a!! Version 2.2.69 (2014-10-13) [[#v2269]]%0aThis version fixes a bug when dates are defined as relative to other dates, eg. "2014-10-13 -3 days". The documentation was updated; note that the instructions in Site.UploadQuickReference were updated to reflect the display of the upload form in current browsers.%0a%0a!! Version 2.2.68 (2014-09-01) [[#v2268]]%0aThis version adds a Skins: InterMap prefix pointing to the Skins section on PmWiki.org, a "signature" markup in the edit quick reference, new WikiStyles clear, min-width and max-width and the documentation was updated.%0a%0a!! Version 2.2.67 (2014-08-02) [[#v2267]]%0aThis version fixes an inconsistency with input forms when values are taken from PageTextVariables. The documentation was updated to the latest state on pmwiki.org.%0a%0a!! Version 2.2.66 (2014-07-02) [[#v2266]]%0aThis version fixes a minor longstanding bug in the default Notification format when a page is deleted. In custom patterns, the "_" character will no longer be considered a function name. The documentation was updated.%0a%0a!! Version 2.2.65 (2014-06-07) [[#v2265]]%0aThis version fixes Pagelist handling of [@{$$PseudoVars}@] when they contain page variables. File permissions handling was improved when the current directory is owned by "root". The documentation was updated.%0a%0a!! Version 2.2.64 (2014-05-08) [[#v2264]]%0aThis version adds the [="{(mod)}"=] markup expression for modulo/remainder calculations, and the "tel:" and "geo:" URI schemes which, on compatible devices like smartphones, allow the creation of links to dial telephone numbers and open map/location applications. %0a%0aThe $SysMergePassthru switch was added, if enabled, it allows the "Simultaneous Edits" conflict resolution to use the passthru() function instead of popen().%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.63 (2014-04-05) [[#v2263]]%0aThis version allows for form elements to have custom attributes containing a dash in the attribute names and enables the attributes 'required', 'placeholder' and 'autocomplete' for HTML5 forms. A minor bug with pagelist [={$$RequestVariables}=] appearing on some installations was fixed. The documentation was updated.%0a%0a!! Version 2.2.62 (2014-02-28) [[#v2262]]%0aThis version adds the variable $EnableTableAutoValignTop which allows to make advanced tables compatible with HTML5. For developers, a fourth argument $template was added to the Markup_e() function, and a callback template 'return' was added. The documentation was updated.%0a%0a!! Version 2.2.61 (2014-01-31) [[#v2261]]%0aThis version removes unnecessary snippets of code and adds the variable $TableCellAlignFmt which allows to make simple tables compatible with HTML5. The documentation was updated.%0a%0a!! Version 2.2.60 (2014-01-12) [[#v2260]]%0aThis version reverts the changes to the pmwiki.css file made in 2.2.59. %0a%0a!! Version 2.2.59 (2014-01-11) [[#v2259]]%0aThis version has an improvement for Blocklist when multiple text fields are posted. A bug with some nested markup conditionals was fixed. The default skin switched font sizes from points (fixed) to percents (relative). A couple of other minor bugs were fixed and the documentation was updated.%0a%0a!! Version 2.2.58 (2013-12-25) [[#v2258]]%0aThis version enables customization of [=(:input auth_form:)=], and fixes a couple of minor bugs. The documentation was updated.%0a%0a!! Version 2.2.57 (2013-11-03) [[#v2257]]%0aThis version enables the use of the Attach: link format in the [[PmWiki/PageDirectives#attachlist|[=(:attachlist:)=]]] directive. The documentation was updated.%0a%0a!! Version 2.2.56 (2013-09-30) [[#v2256]]%0aThis version aims to fix a PHP 5.5 compatibility issue with a deprecated feature of the preg_replace() function. The PageStore() class now detects and works around a bug with the iconv() function, and the documentation was updated.%0a%0a!! Version 2.2.55 (2013-09-16) [[#v2255]]%0aThis version adds the variable $EnableDraftAtomicDiff. If enabled, publishing from a draft version will clear the history of intermediate draft edits, and the published version will contain a single combined diff from the previous published version. The documentation was updated.%0a%0a!! Version 2.2.54 (2013-08-13) [[#v2254]]%0aThis version fixes a bug when old versions are restored from draft pages. The documentation was updated.%0a%0a!! Version 2.2.53 (2013-07-08) [[#v2253]]%0aThis version enables a message to be shown when a post is blocked because of too many unapproved links. The documentation was updated.%0a%0a!! Version 2.2.52 (2013-06-08) [[#v2252]]%0aThis version hides warnings about a deprecated feature in PHP 5.5 installations (preg_replace with /e eval flag). Three new upload extensions were added: docx, pptx and xlsx produced by recent versions of some office suites. The documentation was updated.%0a%0a!! Version 2.2.51 (2013-05-08) [[#v2251]]%0aThis version updates the addresses for the remote blocklists. A minor XSS vulnerability for open wikis, which was discovered today, was fixed. The documentation was updated.%0a%0a!! Version 2.2.50 (2013-04-08) [[#v2250]]%0aThis release only updates the documentation to the latest state on pmwiki.org.%0a%0a!! Version 2.2.49 (2013-03-09) [[#v2249]]%0aThis version adds an array $UploadBlacklist containing forbidden strings of an uploaded filename (case insensitive). Some Apache installations try to execute a file which has ".php", ".pl" or ".cgi" anywhere in the filename, for example, "test.php.txt" may be executed. To disallow such files to be uploaded via the PmWiki interface, add to config.php such a line:%0a%0a $UploadBlacklist = array('.php', '.pl', '.cgi', '.py', '.shtm', '.phtm', '.pcgi', '.asp', '.jsp', '.sh');%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.48 (2013-02-11) [[#v2248]]%0aThis version fixes a bug introduced yesterday with some links. %0a%0a!! Version 2.2.47 (2013-02-10) [[#v2247]]%0aThis version enables tooltip titles in links to anchors in the same page, and the documentation was updated.%0a%0a!! Version 2.2.46 (2013-01-07) [[#v2246]]%0aThis version adds $UploadPermAdd and $UploadPermSet variables, and the documentation was updated.%0a%0aIf your wiki has uploads enabled, it is recommended to set the variable $UploadPermAdd to 0. %0a%0aThe $UploadPermAdd variable sets additional unix permissions applied to newly uploaded files, and should be 0 (recommended as of 2013). If uploaded files cannot be downloaded and displayed on the website, for example with the error 403 Forbidden, set this value to 0444 (core setting, default since 2004). %0a $UploadPermAdd = 0; # recommended%0a%0aThe $UploadPermSet variable unconditionally sets the file permissions on newly uploaded files. Only advanced administrators should use it.%0a%0a%0a!! Version 2.2.45 (2012-12-02) [[#v2245]]%0aThis version fixes some PHP notices appearing on some installations. The documentation was updated.%0a%0a!! Version 2.2.44 (2012-10-21) [[#v2244]]%0aThis version improves the display of consecutive whitespaces in page histories, and fixes the definition of PageTextVariables containing a dash. The documentation was updated.%0a%0a%0a!! Version 2.2.43 (2012-09-20) [[#v2243]]%0aThis version makes it possible to use HTML attribute names that contain dashes, and removes a warning when editing and previewing Site.EditForm. The documentation was updated.%0a%0a!! Version 2.2.42 (2012-08-20) [[#v2242]]%0aThis version provides a workaround for cases when a wiki page contains a character nonexistent in the active encoding. The documentation was updated.%0a%0a!! Version 2.2.41 (2012-08-12) [[#v2241]]%0aThis version changes the internal $KeepToken separator to be compatible with more encodings. The documentation was updated.%0a%0a!! Version 2.2.40 (2012-07-21) [[#v2240]]%0aThis version provides a helper function replacing htmlspecialchars() and compatible with PHP 5.4. The documentation was updated.%0a%0a!! Version 2.2.39 (2012-06-25) [[#v2239]]%0aThis version provides a fix for links to attachments containing international characters. The documentation was updated.%0a%0a!! Version 2.2.38 (2012-05-21) [[#v2238]]%0aThis version fixes a "parameter count" warning which appeared on some websites.%0a%0a!! Version 2.2.37 (2012-05-01) [[#v2237]]%0aThis version provides a workaround for installations with broken iconv() function, while optimizing the recode function. This should fix the "Unable to retrieve edit form" problem in some wikis. Dots in [[#anchor_1.2]] sections are now better supported, PageVariables are expanded in PageList template defaults, and the documentation is updated.%0a%0a!! Version 2.2.36 (2011-12-28) [[#v2236]]%0aThis version fixes the recode function to try to recover Windows-1252 characters in ISO-8859-1 files. A new variable $EnableOldCharset enables the $page["=oldcharset"] entry which will be used in the future. A couple of minor bugs were fixed and the documentation was updated.%0a%0a!! Version 2.2.35 (2011-11-11) [[#v2235]]%0aThis release fixes a critical PHP injection vulnerability, reported today by Egidio Romano. PmWiki versions 2.2.X, 2.1.X, 2.0.X and 2.0.beta33 and newer are vulnerable. When you upgrade, please read carefully the Release notes for all PmWiki versions since yours.%0a%0aIf you cannot upgrade, it is recommended to disable Searches at the earliest opportunity (even if your wiki skin doesn't have a search form). Add to config.php such a line:%0a if ($action == 'search') $action = 'browse';%0a%0aIf your old version wiki allows editing by not entirely trusted visitors, even on limited pages like a WikiSandbox, you should also disable PageLists. Add to config.php this line:%0a $EnablePageList = 0;%0a%0aThis version has an important change for international wikis: the XLPage() function no longer loads encoding scripts such as xlpage-utf-8.php. When you upgrade, you need to include those scripts from config.php, before calling XLPage():%0a%0a include_once("scripts/xlpage-utf-8.php"); # if your wiki uses UTF-8%0a XLPage('bg','PmWikiBg.XLPage');%0a%0aAll links can now have tooltip titles. Previously, only images and external links could have tooltip titles, now this feature is enabled for internal links. To set a tooltip title, add it in quotes after the link address:%0a[@%0a [[Main.HomePage"This is a tooltip title"]]%0a [[Main.HomePage"This is a tooltip title"|Home]]%0a [[http://www.pmwiki.org"Home of PmWiki"]]%0a Attach:image.jpg"Tooltip title of the image"%0a@]%0a%0aThe following new upload extensions were added: svg, xcf, ogg, flac, ogv, mp4, webm, odg, epub. A couple of minor optimizations were added (MarkupExpressions and rendering of page history) and the documentation was updated.%0a%0a!! Version 2.2.34 (2011-10-10) [[#v2234]]%0aThis version resets the timestamps of the default pages Site(Admin).AuthUser which are expected in case of upgrades from the versions 2.1.*. Core MarkupExpressions which manipulate strings should now work better with international characters. The documentation was updated to its latest state from pmwiki.org.%0a%0a!! Version 2.2.33 (2011-09-23) [[#v2233]]%0aThis version fixes a security bug introduced in 2.2.32 which left the groups Site and SiteAdmin open for reading and editing because the pages Site.GroupAttributes and SiteAdmin.GroupAttributes didn't have all necessary attributes. %0a%0aAll wikis running 2.2.32 should upgrade. If you cannot immediately upgrade, you can set the attributes from your wiki:%0a* open the attributes page [=[[SiteAdmin.GroupAttributes?action=attr]]=] and set a "read" and an "edit" password, @@ @lock @@ is recommended.%0a* open the attributes page [=[[Site.GroupAttributes?action=attr]]=] and set an "edit" password, @@ @lock @@ is recommended. Do not set a "read" password here.%0a%0aThe release also fixes the refcount.php script to produce valid HTML, and updates intermap.txt entries PITS: and Wikipedia: to point to their current locations.%0a%0a!! Version 2.2.32 (2011-09-18) [[#v2232]]%0aThis is the first version shipping with the core documentation in the UTF-8 encoding. PmWiki will automatically convert it on the fly for wikis using an older encoding.%0a%0aIt is recommended that all '''new''' PmWiki installations enable UTF-8. Migration of ''existing'' wikis from an older encoding to UTF-8 shouldn't be rushed: it is not trivial and will be documented in the future.%0a%0aA required HTML xmlns attribute was added to the print skin template. The history rendering is now faster when many lines are added or removed.%0a%0a%25note%25 Note: Due to a manipulation error, a version 2.2.31 was created before it was ready for a release.%0a%0a!! Version 2.2.30 (2011-08-13) [[#v2230]]%0aThis version fixes a $Charset definition in international iso-8859-*.php files. This will help for a future transition to UTF-8. %0a%0aA variable $EnableRangeMatchUTF8 was added, set it to 1 to enable range matches of pagenames in UTF-8 like [A-D]. Previously the range matches were always enabled in UTF-8, but we found out that on some installations this feature breaks all pagelists, even those without range matches. In case the feature worked for you, you can re-enable it.%0a%0a!! Version 2.2.29 (2011-07-24) [[#v2229]]%0aThis release fixes Attach links that were broken with the Path fix in 2.2.28 earlier today.%0a%0a!! Version 2.2.28 (2011-07-24) [[#v2228]]%0aThis release fixes 2 potential XSS vulnerabilities and a bug with Path: links.%0a%0a!! Version 2.2.27 (2011-06-19) [[#v2227]]%0aThis release fixes a validation bug on pages after a redirection. A new block WikiStyle [@%25justify%25@] was added, allowing left and right aligned text. The page history now accepts a URL parameter @@?nodiff=1@@ which hides the rendering of edit differences, showing only timestamps, authors, summaries and "Restore" links; it allows to restore a vandalized page with a huge contents or history which otherwise would break the memory or time limits of the server.%0a%0a!! Version 2.2.26 (2011-05-21) [[#v2226]]%0aThis release fixes a redundant removal of link hashes from WikiTrails, and updates the documentation to the most recent version from PmWiki.org.%0a%0a!! Version 2.2.25 (2011-03-22) [[#v2225]]%0aThis release only updates the documentation to the latest state on pmwiki.org.%0a%0a!! Version 2.2.24 (2011-02-15) [[#v2224]]%0aThis version reverts the way existing PageVariables are processed, like version 2.2.21 or earlier, but it adds a special variable $authpage which can be used in PageVar definitions. It is the same as the $page array, but exists only if the visitor has read permissions. For example, an administrator can set to config.php:%0a%0a $FmtPV['$LastModifiedSummary'] = '@$authpage["csum"]'; # instead of '@$page["csum"]'%0a%0aThen, the edit summary metadata will only be available if the user has read permissions.%0a%0a!! Version 2.2.23 (2011-01-25) [[#v2223]]%0aThis version sets the default value of $EnablePageVarAuth to 0 until we investigate a reported problem with authentication.%0a%0a!! Version 2.2.22 (2011-01-16) [[#v2222]]%0aThis version adds the variable $EnableXLPageScriptLoad which, if set to 0, will prevent authors to load scripts from XLPage and to accidentally change the encoding of the wiki. If you use it, make sure you include the required files, eg. xlpage-utf-8.php from local config files.%0a%0aPageVariables should now respect authentications: without read permissions, the title, description, change summary, author of a protected page are unavailable. PageVariables that are computed without reading the page are still available (eg. $Group, $Namespaced, $Version etc.). Administrators can revert the previous behavior by adding to config.php such a line:%0a%0a@@ $EnablePageVarAuth = 0; @@%0a%0a!! Version 2.2.21 (2010-12-14) [[#v2221]]%0aDue to a mis-configuration of a local svn repository, some of the changes intended for 2.2.20 didn't make it in the correct branch. This release corrects this.%0a%0a!! Version 2.2.20 (2010-12-14) [[#v2220]]%0aThis version fixes a potential XSS vulnerability, reported today. An AuthUser bug with excluding users from authgroups was fixed. A new InterMap prefix PmL10n: was added, it leads to the Localization section on PmWiki.org and should help the work of translators. A couple of other minor bugs were fixed and the documentation was updated.%0a%0a!! Version 2.2.19 (2010-11-10) [[#v2219]]%0aThis is a documentation-update release.%0a%0a!! Version 2.2.18 (2010-09-04) [[#v2218]]%0aThis version fixes 3 minor bugs, and updates the documentation.%0a%0a!! Version 2.2.17 (2010-06-20) [[#v2217]]%0aThis version adds a variable $PostConfig containing functions and scripts to be loaded after stdconfig.php. Tabindex was added as a valid form field attribute. Protected downloads now respect existing browser caches. AuthUser now allows more flexible cookbook recipe integration. A couple of bugs were fixed and the documentation was updated.%0a%0a!! Version 2.2.16 (2010-05-10) [[#v2216]]%0aThis version fixes a bug with parsing html attributes which could allow XSS injection. Wikis allowing unprotected editing are encouraged to upgrade.%0a%0aA bug with the "center" button of the GUI edit toolbar was corrected.%0a%0aThe "exists" conditional now accepts wildcards, for example:%0a [@(:if exists Main.*:)There are pages in the Main group (:if:)@]%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.15 (2010-03-27) [[#v2215]]%0aThis version adds some minor bugfixes and optimizations notably a bug with @@[=(:template none:)=]@@ introduced in the last version 2.2.14.%0a%0a!! Version 2.2.14 (2010-02-27) [[#v2214]]%0aThis release corrects inline styles for WikiTrail links. Undefined include/template @@ [={$$variables}=] @@ are now removed from the included section, like Page(Text)Variables, and can be used in conditional expressions. If needed, this change can be reverted by adding to config.php such a line:%0a%0a[@%0a $EnableUndefinedTemplateVars = 1; # keep and display unset {$$variables}%0a@]%0a%0aPageList templates now accept the sections @@ !first @@ and @@ !last @@ for markup to appear for every page in list ''except'' the first or last one.%0a%0a"Title" attributes were added to external links. You can have tooltip titles on external links, including InterMap and attachments, by adding the link title in double quotes after the URL:%0a [=[[http://www.pmwiki.org"Home of PmWiki"| External link]]=]%0a%0aFor international wikis, PmWiki now automatically translates the titles of technical pages like GroupAttributes or RecentChanges -- just define these strings as usual in XLPage, for example, in French:%0a 'AllRecentChanges' => 'Tous les changements récents',%0a%0aSome minor optimizations were done and the documentation was updated.%0a%0a!! Version 2.2.13 (2010-02-21) [[#v2213]]%0aThis release fixes a bug with $DiffKeepNum introduced in 2.2.10 -- the count of revisions was incorrect and a page could drop more revisions than it should.%0a%0aThe [[page history]] layout was modified with a rough consensus in the community. The history now defaults to "source" view with word-level highlighting of the differences. Authors can see the changes in rendered output by clicking on the link "Show changes to output". Admins can switch back the default by adding such a line to config.php:%0a%0a $DiffShow['source'] = (@$_REQUEST['source']=='y')?'y':'n';%0a%0aTo disable word-level highlighting and show plain text changes:%0a%0a $EnableDiffInline = 0;%0a%0aIn the page history rendering, a few minor bugs were fixed and the code was slightly optimized.%0a%0aThe documentation was updated.%0a%0a!! Version 2.2.12 (2010-02-17) [[#v2212]]%0aThis release adds simple word-level highlighting of differences in the page history, when "Show changes to markup" is selected. To enable the feature, add to config.php such a line:%0a $EnableDiffInline = 1;%0a%0aThis feature is like what the InlineDiff recipe provides, but not exactly the same, and the implementation is simpler. It is enabled on PmWiki.org and can be improved -- your comments are welcome.%0a%0a!! Version 2.2.11 (2010-02-14) [[#v2211]]%0aThis release adds two new table directives for header cells, [=(:head:) and (:headnr:)=]. They work the same way as [=(:cell:) and (:cellnr:)=] except that create %3cth> instead of %3ctd> html tags.%0a%0aThe pagerev.php script was refactored into separate functions to allow easier integration of recipes displaying the page history.%0a%0aA couple of minor bugs were fixed and the documentation was updated.%0a%0a!! Version 2.2.9, 2.2.10 (2010-01-17) [[#v2210]]%0aMost important in this release is the official change of $EnableRelativePageVars to 1. The change is about how [={$Variable}=] in included pages is understood by PmWiki.%0a* When $EnableRelativePageVars is set to 0, [={$Name}=] displays the name of the currently browsed page. Even if [={$Name}=] is in an included page, it will display the name of the browsed page.%0a* When $EnableRelativePageVars is set to 1, [={$Name}=] displays the name of the physical page where it written. If [={$Name}=] is in an included page, it will display the name of the included page.%0a* [={*$Name}=] always displays the name of the currently browsed page, regardless of $EnableRelativePageVars.%0a%0aSo, if your wiki relies on page variables from included pages, and doesn't have $EnableRelativePageVars set to 1, after upgrading to 2.2.9, you can revert to the previous behavior by adding to config.php such a line:%0a $EnableRelativePageVars = 0;%0a%0aMore information about page variables can be found at:%0a http://www.pmwiki.org/wiki/PmWiki/PageVariables%0a%0aThis release adds a new variable $EnablePageTitlePriority which defines how to treat multiple [=(:title..:)=] directives. If set to 1, the first title directive will be used, and if a page defines a title, directives from included pages cannot override it. PmWiki default is 0, for years, the last title directive was used (it could come from an included page or GroupFooter).%0a%0aThis release also adds a new variable $DiffKeepNum, specifying the minimum number (default 20) of edits that will be kept even if some of them are older than the limit of $DiffKeepDays.%0a%0aA number of bugs were fixed and the documentation was updated.%0a%0a!! Version 2.2.8 (2009-12-07) [[#v228]]%0aThis release fixes another PHP 5.3 compatibility issue with conditional markup. The Author field now handles apostrophes correctly. The documentation was updated.%0a%0a!! Version 2.2.7 (2009-11-08) [[#v227]]%0aThis release fixes most PHP 5.3 compatibility issues. Unfortunately some specific builds for Windows may still have problems, which are unrelated to PmWiki. Notably, on Windows, all passwords need to be 4 characters or longer.%0a%0aUpload names with spaces are now correctly quoted. The documentation was updated.%0a%0a!! Version 2.2.6 (2009-10-04) [[#v226]]%0aWith this release it is now possible to display recently uploaded files to the RecentChanges pages -- if you have been using the RecentUploadsLog recipe, please uninstall it and follow the instructions at http://www.pmwiki.org/wiki/Cookbook/RecentUploadsLog.%0a%0aThe release also introduces $MakeUploadNamePatterns to allow custom filename normalization for attachements. It is now possible to replace $PageListFilters and $FPLTemplateFunctions with custom functions. Notify should now work in safe_mode. Some bugs were fixed, among which one with conditional markup with dates. The documentation was updated.%0a%0a!! Version 2.2.5 (2009-08-25) [[#v225]]%0aThis release adds a new markup for Pagelist templates, [@(:template none:)@] which allows a message to be set when the search found no pages. The FPLTemplate() function was broken into configurable sub-parts to allow development hooks. A number of bugs were fixed, and the documentation was updated.%0a%0a!! Version 2.2.4 (2009-07-16) [[#v224]]%0aThis release fixes a bug introduced earlier today with HTML entities in XLPages.%0a%0a!! Version 2.2.3 (2009-07-16) [[#v223]]%0aThis release fixes six potential XSS vulnerabilities, reported by Michael Engelke. The vulnerabilities may affect wikis open for editing and may allow the injection of external JavaScripts in their pages. Public open wikis should upgrade.%0a%0aA new variable $EnableUploadGroupAuth was added; if set to 1, it allows password-protected [[uploads]] to be checked against the Group password. %0a%0aIt is now possible to use @@ @_site_edit, @_site_read, @_site_admin@@ or @@ @_site_upload @@ global [[passwords]] in GroupAttributes pages.%0a%0aA number of other small bugs were fixed, and the documentation was updated.%0a%0a!! Version 2.2.2 (2009-06-21) [[#v222]]%0aThe major news in this release is a fix of an AuthUser vulnerability.%0a%0aThe vulnerability affects only wikis that (1) rely on the AuthUser core module %0afor User:Password authentication, -AND- (2) where the PHP installation runs %0awith the variable "magic_quotes_gpc" disabled.%0a%0aAll PmWiki 2.1.x versions from pmwiki-2.1.beta6 on, all 2.2.betaX, 2.2.0, and %0a2.2.1 are affected.%0a%0aThe PmWiki [[SiteAnalyzer]] can detect if your wiki needs to upgrade:%0a http://www.pmwiki.org/wiki/PmWiki/SiteAnalyzer%0a%0aIf your wiki is vulnerable, you should do one of the following at the earliest %0aopportunity:%0a%0a* Upgrade to a version of PmWiki at least 2.2.2 or greater.%0a* Turn on magic_quotes_gpc in the php.ini file or in a .htaccess file.%0a%0aAlternatively, you can temporarily disable AuthUser until you upgrade.%0a%0aNote that even if your wiki does not have the AuthUser vulnerability at the %0amoment, you are strongly encouraged to upgrade to PmWiki version 2.2.2 or %0alater, as some future configuration of your hosting server might put you at %0arisk.%0a%0aThis release also comes with minor updates in the local documentation; fixes %0awere applied for international wikis - notably global variables in %0axlpage-utf-8.php and a new variable $EnableNotifySubjectEncode, which allows %0ae-mail clients to correctly display the Subject header; and a number of other %0asmall bugs were fixed.%0a%0a!! Version 2.2.1 (2009-03-28) [[#v221]]%0aThis release comes with an updated local documentation; [[wiki trails]] now work cross-group; guiedit.php now produces valid HTML, and other small bugs were fixed. We also added $EnableRedirectQuiet, which allows redirects to take place without any mention of "redirected from page ....".%0a%0a!! Version 2.2.0 (2009-01-18) [[#v220]]%0a%0aThis is a summary of changes from 2.1.x to 2.2.0.%0a%0a* Several pages that were formerly in the [[Site]].* group are now in a separate [[SiteAdmin]].* group, which is read-restricted by default. The affected pages include Site.AuthUser, Site.AuthList, Site.NotifyList, Site.Blocklist, and Site.ApprovedUrls . If upgrading from an earlier version of PmWiki, PmWiki will prompt to automatically copy these pages to their new location if needed. If a site wishes to continue using the old Site.* group for these pages, simply set%0a%0a-> $SiteAdminGroup = $SiteGroup;%0a%0a-> when carrying out this upgrade inspect your config files for lines such as%0a--> $BlocklistDownload['Site.Blocklist-PmWiki'] = array('format' => 'pmwiki');%0a->as you may wish to fix then, eg%0a--> $BlocklistDownload[$SiteAdminGroup . '.Blocklist-PmWiki'] = array('format' => 'pmwiki');%0a%0a* Important Change in Passwords in PmWiki 2.2 indicating that the group can be edited even if a site password is set will be done by @@"@nopass"@@ prior it was done by @@"nopass"@@%0a-> When migrating a wiki you will have to manually modify the permission or by a script replace in all the page concerned @@passwdread=nopass:@@ by @@passwdread=@nopass@@ (see PITS:00961) --isidor%0a%0a* PmWiki now ships with WikiWords entirely disabled by default. To re-enable them, set either $LinkWikiWords or $EnableWikiWords to 1. To get the 2.1 behavior where WikiWords are spaced and parsed but don't form links, use the following:%0a-> $EnableWikiWords = 1;%0a-> $LinkWikiWords = 0;%0a%0a* It's now easy to disable the rule that causes lines with leading spaces to be treated as preformatted text -- simply set $EnableWSPre=0; to disable this rule.%0a%0a--> '''Important:''' There is ongoing discussion that the leading whitespace rule may be disabled ''by default'' in a future versions of PmWiki. If you want to make sure that the rule will continue to work in future upgrades, set $EnableWSPre=1; in ''local/config.php''.%0a%0a* The $ROSPatterns variable has changed somewhat -- replacement strings are no longer automatically passed through FmtPageName() prior to substitution (i.e., it must now be done explicitly).%0a%0a* Page variables and page links inside of [@(:include:)@] pages are now treated as relative to the included page, instead of the currently browsed page. In short, the idea is that links and page variables should be evaluated with respect to the page in which they are written, as opposed to the page in which they appear. This seems to be more in line with what authors expect. There are a number of important ramifications of this change:%0a%0a[[#relativeurls]]%0a** We now have a new [@{*$var}@] form of page variable, which always refers to "the currently displayed page". Pages such as Site.PageActions and Site.EditForm that are designed to work on "the currently browsed page" should generally switch to using [@{*$FullName}@] instead of [@{$FullName}@].%0a%0a** The $EnableRelativePageLinks and $EnableRelativePageVars settings control the treatment of links and page variables in included pages. However, to minimize disruption to existing sites, $EnableRelativePageVars defaults to '''disabled'''. This will give existing sites an opportunity to convert any absolute [@{$var}@] references to be [@{*$var}@] instead.%0a%0a** Eventually $EnableRelativePageVars will be enabled by default, so we highly recommend setting [@$EnableRelativePageVars = 1;@] in ''local/config.php'' to see how a site will react to the new interpretation. Administrators should especially check any customized versions of the following:%0a---> [[Site.PageActions]]%0a---> [[Site.EditForm]]%0a---> [[Site.PageNotFound]]%0a---> SideBar pages with ?action= links for the current page%0a---> $GroupHeaderFmt, $GroupFooterFmt%0a---> [[Page lists]] that refer to the current group or page, etc in sidebars, headers, and footers%0a%0a** The [@(:include:)@] directive now has a [@basepage=@] option whereby an author can explicitly specify the page upon which relative links and page variables should be based. If no basepage= option is specified, the included page is assumed to be the base.%0a%0a* Sites that want to retain the pre-2.2 behavior of [@(:include:)@] and other items can set [@$Transition['version'] = 2001900;@] to automatically retain the 2.1.x defaults.%0a%0a* Text inserted via [@(:include:)@] can contain "immediate substitutions" of the form [@{$$option}@] -- these are substituted with the value of any options provided to the include directive.%0a%0a* PmWiki now recognizes when it is being accessed via "https:" and switches its internal links appropriately. This can be overridden by explicitly setting $ScriptUrl and $PubDirUrl.%0a%0a* A new $EnableLinkPageRelative option allows PmWiki to generate relative urls for page links instead of absolute urls.%0a%0a* Draft handling capabilities have been greatly improved. When $EnableDrafts is set, then the "Save" button is relabeled to "Publish" and a "Save draft" button appears. In addition, an $EnablePublishAttr configuration variable adds a new "publish" authorization level to distinguish editing from publishing. See [[PmWiki:Drafts]] for more details.%0a%0a[[#ptvstart]]%0a* There is a new [@{$:var}@] "page text variable" available that is able to grab text excerpts out of markup content. For example, [@{SomePage$:Xyz}@] will be replaced by a definition of "Xyz" in SomePage. Page text variables can be defined using definition markup, a line beginning with the variable name and a colon, or a special directive form (that doesn't display anything on output):%0a%0a-->[@%0a:Xyz: some value # definition list form%0aXyz: some value # colon form%0a(:Xyz: some value:) # directive form%0a@]%0a[[#ptvend]]%0a%0a* The [@(:pagelist:)@] command can now filter pages based on the contents of page variables and/or page text variables. For example, the following directive displays only those pages that have an "Xyz" page text variable with "some value":%0a%0a-->[@(:pagelist $:Xyz="some value":)@]%0a%0a Wildcards also work here, thus the following pagelist command lists pages where the page's title starts with the letter "a":%0a%0a-->[@(:pagelist $Title=A* :)@]%0a%0a* The if= option to [@(:pagelist)@] can be used to filter pages based on conditional markup:%0a%0a-->[@(:pagelist if="auth upload {=$FullName}":)@] pages with upload permission%0a-->[@(:pagelist if="date today.. {=$Name}":)@] pages with names that are dates later than today%0a%0a* Spaces no longer separate wildcard patterns -- use commas. (Most people have been doing this already.)%0a%0a* Because page variables are now "relative", the [@{$PageCount}, {$GroupCount}, {$GroupPageCount}@] variables used in pagelist templates are now [@{$$PageCount}, {$$GroupCount}, {$$GroupPageCount}@].%0a%0a* One can now use [@{$$option}@] in a pagelist template to obtain the value of any 'option=' provided to the [@(:pagelist:)@] command.%0a%0a* The [@(:pagelist:)@] directive no longer accepts parameters from urls or forms by default. In order to have it accept such parameters (which was the default in 2.1 and earlier), add a [@request=1@] option to the [@(:pagelist:)@] directive.%0a%0a* The [@count=@] option to pagelists now accepts negative values to count from the end of the list. Thus [@count=5@] returns the the first five pages in the list, and [@count=-5@] returns the last five pages in the list. In addition, ranges of pages may be specified, as in [@count=10..19@] or [@count=-10..-5@].%0a%0a* Pagelist templates may have special [@(:template first ...:)@] and [@(:template last ...:)@] sections to specify output for the first or last page in the list or a group. There's also a [@(:template defaults ...:)@] to allow a template to specify default options.%0a%0a* PmWiki comes with an ability to cache the results of certain [@(:pagelist:)@] directives, to speed up processing on subsequent visits to the page. To enable this feature, set $PageListCacheDir to the name of a writable directory (e.g., ''work.d/'').%0a%0a* [[#elseifelse]]The [@(:if ...:)@] conditional markup now also understands [@(:elseif ...:)@] and [@(:else:)@]. In addition, markup can nest conditionals by placing digits after if/elseif/else, as in [@(:if1 ...)@], [@(:elseif1 ...:)@], [@(:else1:)@], etc.%0a%0a* The [@(:if date ...:)@] conditional markup can now perform date comparisons for dates other than the current date and time.%0a%0a* [[WikiTrails]] can now specify #anchor identifiers to use only sections of pages as a trail.%0a%0a* A new [@(:if ontrail ...:)@] condition allows testing if a page is listed on a trail.%0a%0a* The extensions .odt, .ods, and .odp (from OpenOffice.org) are now recognized as valid attachment types by default.%0a%0a* A new [[blocklist]] capability has been added to the core distribution. It allows blocking of posts based on IP address, phrase, or regular expression, and can also make use of publicly available standard blocklists. See [[PmWiki.Blocklist]] for details.%0a%0a* There is a new [[SiteAdmin.AuthList]] page that can display a summary of all password and permissions settings for pages on a site. This page is restricted to administrators by default.%0a%0a* There are new [@{$PasswdRead}@], [@{$PasswdEdit}@], etc. variables that display the current password settings for a page (assuming the browser has attr permissions or whatever permissions are set in $PasswdVarAuth).%0a%0a* Forms creation via the [@(:input:)@] markup has been internally refactored somewhat (and may still undergo some changes prior to 2.2.0 release). The new [@(:input select ...:)@] markup can be used to create select boxes, and [@(:input default ...:)@] can be used to set default control values, including for radio buttons and checkboxes.%0a%0a* The [@(:input textarea:)@] markup now can take values from other sources, including page text variables from other pages.%0a%0a* Specifying [@focus=1@] on an [@(:input:)@] control causes that control to receive the input focus when a page is loaded. If a page has multiple controls requesting the focus, then the first control with the lowest value of [@focus=@] "wins".%0a%0a* PmWiki now provides a ''scripts/creole.php'' module to enable Creole standard markup. To enable this, add [@include_once('scripts/creole.php')@] to a local customization file.%0a%0a* PmWiki adds a new [@{(...)}@] ''markup expression'' capability, which allows various simple string and data processing (e.g., formatting of dates and times). This is extensible so that recipe authors and system administrators can easily add custom expression operators.%0a%0a* It's now possible to configure PmWiki to automatically create Category pages whenever a page is saved with category links and the corresponding category doesn't already exist. Pages are created only if the author has appropriate write permissions into the group. To enable this behavior, add the following to ''local/config.php'':%0a%0a-->[@$AutoCreate['/^Category\\./'] = array('ctime' => $Now);@]%0a%0a* Sites with wikiwords enabled can now set $WikiWordCount['WikiWord'] to -1 to indicate that 'WikiWord' should not be spaced according to $SpaceWikiWords.%0a%0a* WikiWords that follow # or & are no longer treated as WikiWords.%0a%0a* Links to non-existent group home pages (e.g., [@[[Group.]]@] and [@[[Group/]]@]) will now go to the first valid entry of $PagePathFmt, instead of being hardcoded to "Group.Group". For example, to set PmWiki to default group home pages to [@$DefaultName@], use%0a%0a-->[@$PagePathFmt = array('{$Group}.$1', '$1.{$DefaultName}', '$1.$1');@]%0a%0a* PmWiki now provides a $CurrentTimeISO and $TimeISOFmt variables, for specifying dates in ISO format.%0a%0a* [[(Cookbook:)Cookbook]] authors can use the internal PmWiki function UpdatePage (temporarily documented at [[(Cookbook:)DebuggingForCookbookAuthors]]) to change page text while preserving history/diff information, updating page revision numbers, updating RecentChanges pages, sending email notifications, etc.%0a%0a* [[Skin templates]] are now required to have %3c!--HTMLHeader--> and %3c!--HTMLFooter--> directives. Setting $EnableSkinDiag causes PmWiki to return an error if this isn't the case for a loaded skin. Skins that explicitly do not want HTMLHeader or HTMLFooter sections can use %3c!--NoHTMLHeader--> and %3c!--NoHTMLFooter--> to suppress the warning.%0a%0a* Added a new "pre" wikistyle for preformatted text blocks.%0a%0a* The xlpage-utf-8.php script now understands how to space UTF-8 wikiwords. %0a%0a* Searches on utf-8 site are now case-insensitive for utf-8 characters.%0a%0a* Many Abort() calls now provide a link to pages on pmwiki.org that can explain the problem in more detail and provide troubleshooting assistance.%0a%0a* PmWiki no longer reports "?cannot acquire lockfile" if the visitor is simply browsing pages or performing other read-only actions.%0a%0a* The $EnableReadOnly configuration variable can be set to signal PmWiki that it is to run in "read-only" mode (e.g., for distribution on read-only media). Attempts to perform actions that write to the disk are either ignored or raise an error via Abort().%0a%0a* Including authuser.php no longer automatically calls ResolvePageName().%0a%0a* Authentication using Active Directory is now simplified. In Site.AuthUser or the $AuthUser variable, set "ldap://name.of.ad.server/" with no additional path information (see PmWiki.AuthUser for more details).%0a%0a* Pages are now saved with a "charset=" attribute to identify the character set in effect when the page was saved.%0a%0a* The phpdiff.php algorithm has been optimized to be smarter about finding smaller diffs.%0a%0a* Removed the (deprecated) "#wikileft h1" and "#wikileft h5" styles from the pmwiki default skin.%0a%0a* The mailposts.php and compat1x.php scripts have been removed from the distribution.%0a%0a----%0aBugs and other requests can be reported to the PmWiki Issue Tracking %0aSystem at http://www.pmwiki.org/wiki/PITS/PITS. Any help%0ain testing, development, and/or documentation is greatly appreciated.%0a%0a[[(PmWiki:)Release Notes archive]] - notes for versions older than 2.2.0.%0a +time=1724226448 title=Release Notes diff --git a/wikilib.d/PmWiki.Tables b/wikilib.d/PmWiki.Tables index fa8ca9bd..dde1cb2e 100644 --- a/wikilib.d/PmWiki.Tables +++ b/wikilib.d/PmWiki.Tables @@ -1,10 +1,10 @@ -version=pmwiki-2.3.30 ordered=1 urlencoded=1 +version=pmwiki-2.3.36 ordered=1 urlencoded=1 author=Petko charset=UTF-8 -csum=pmhlt (+69) +csum=rowspan (+729) ctime=1141945978 name=PmWiki.Tables -rev=114 +rev=116 targets=PmWiki.TableDirectives,Cookbook.RowspanInSimpleTables,Cookbook.FormattingTables,PmWiki.LayoutVariables,PmWiki.WikiStyles -text=(:Audience: authors (basic) :)%0a(:Summary:Simple tables with double pipe markup, one row per line:)%0a%0aPmWiki has two types of table markup; the markup described in this page is useful for creating ''simple'' tables with lots of small cells, while [[table directive markup->table directives]] helps with larger scale or more complex tables. For more possibilities with formatting simple tables, see [[Cookbook:Rowspan in simple tables]] and [[Cookbook:Formatting tables]].%0a%0a!! Table basics%0aSimple tables are created via use of double pipe characters: %25pmhlt%25@@||@@%25%25. Lines beginning with this markup denote rows in a table or a formatting line. Within table row lines the double-pipe is used to delimit cells. In the examples below a border is added for illustration (the default is no border).%0a%0aThe first line in the markup (initial double bars "%25pmhlt%25@@||@@%25%25") is required. After the double bars, there may be optional formatting commands for the table such as border or width.%0a%0a(:markup caption='Basic table' class=horiz:)%0a|| border=1%0a|| cell 1 || cell 2 || cell 3 ||%0a|| cell 1 || cell 2 ||%0a(:markupend:)%0a%0aHeader cells can be created by placing ! as the first character of a cell. Note that these are ''table headers'', not ''headings'', so it doesn't extend to !!, !!!, etc.%0a%0a(:markup caption='Table with borders and headers' class=horiz:)%0a|| border=1%0a||! cell 1 ||! cell 2 ||! cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0aA table can have a caption, indicated by [@||!caption!||@]. Any caption must appear prior to other rows of the table.%0a%0a(:markup caption='Table caption' class=horiz:)%0a|| border=1%0a||! A special table !||%0a||! cell 1 ||! cell 2 ||! cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0a%0a!! Formatting cell contents%0a%0aCell contents may be aligned left, centered, or aligned right. %0a* To left-align contents, place the cell contents next to the leading %25pmhlt%25@@||@@%25%25.%0a* To center contents, add a space before and after the cell contents.%0a* To right-align contents, place a space before the cell contents and leave the cell contents next to the trailing %25pmhlt%25@@||@@%25%25.%0a%0a(:markup caption='Cell alignments':)%0a|| border=1 width=100%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0a(:markupend:)%0a%0a(:markup caption='Default cell alignments':)%0a|| border=1 width=100%25%0a||!cell default||!cell left ||%0a||default-aligned||left-aligned ||%0a(:markupend:)%0a%0aNote that header and detail cells have different default alignments.%0a%0aTo get a cell to span multiple columns, follow the cell with empty cells.%0a(At present there is no markup for spanning rows.)%0a%0a(:markup caption='Column spanning':)%0a|| border=1 width=100%25%0a|| |||| right column ||%0a|| || right two columns ||||%0a|| || middle column || ||%0a|| left column || ||||%0a|| left two columns |||| ||%0a|| entire row ||||||%0a|| left column || middle column || right column ||%0a(:markupend:)%0a%0a!! Table attributes%0a%0aAny line that begins with %25pmhlt%25@@||@@%25%25 but doesn't have a closing %25pmhlt%25@@||@@%25%25 sets the ''table attributes'' for any tables that follow. These attributes can control the size and position of the table, borders, background color, and cell spacing. (In fact these are just standard HTML attributes that are placed in the %3ctable> tag.)%0a%0aUse the [@width=@] attribute to set a table's width, using either a percentage value, an absolute size, or '''*'''.%0a%0aSee also $SimpleTableDefaultClassName.%0a%0a(:markup caption='Table width':)%0a|| border=1 width=100%25 %0a|| cell 1 || cell 2 || cell 3 ||%0a|| c1 || cellcellcellcell2 || cell 3 ||%0a(:markupend:)%0a%0aThe [@border=@] attribute sets the size of a table's borders.%0a%0a(:markup caption='Bordered table' class=horiz:)%0a|| border=10 width=70%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0a(:markupend:)%0a%0a(:markup caption='Borderless table' class=horiz:)%0a|| border=0 width=70%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0a(:markupend:)%0a%0aUse [@align=center@], [@align=left@], and [@align=right@] to center, left, or right align a table. Note that [@align=left@] and [@align=right@] create a ''floating table'', such that text wraps around the table.%0a%0a(:markup caption='Table alignment: center':)%0a|| border=1 align=center width=50%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0aNotice how text does not wrap with a table using "align=center".%0a(:markupend:)%0a%0a(:markup caption='Table alignment: left':)%0a|| border=1 align=left width=50%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0aNotice how text wraps to the right of a table using "align=left".%0a(:markupend:)%0a%0a(:markup caption='Table alignment: right':)%0a|| border=1 align=right width=50%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0aNotice how text wraps to the left of a table using "align=right".%0a(:markupend:)%0a%0aNote: to get a table to align left (but not "float left") requires CSS, as in%0a->%25pmhlt%25[@||style="margin-left:0px;"@]%0a%0aThe [@bgcolor=@] attribute sets the background color for a table. At present there is no way to specify the color of individual rows or cells in this type of table (but see Cookbook:FormattingTables).%0a%0a(:markup class=horiz:)%0a|| border=1 align=center bgcolor=yellow width=70%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-align || center || right-align||%0a(:markupend:)%0a%0a!! Sortable tables [[#sortable]]%0aTo allow readers to reorder a table, give it the class="sortable" attribute:%0a(:markup:)%0a|| class="sortable simpletable"%0a||! m||!Geographic zone ||!Highest point ||!Country ||%0a|| 3700||Arctic ||Gunnbjørn Fjeld ||Greenland ||%0a|| 8848||North Temperate Zone ||Mount Everest ||Nepal ||%0a|| 5790||North Tropical Zone ||Cayambe ||Ecuador ||%0a|| 6768||South Tropical Zone ||Huáscarán ||Peru ||%0a|| 6960||South Temperate Zone ||Aconcagua ||Argentina ||%0a|| 4892||Antarctic ||Mount Vinson ||(none) ||%0a(:markupend:)%0a%0aNotes:%0a* This feature has to be enabled in local configuration, see $EnableSortable. It will then work both for simple tables as above, and for [[table directives]] with the class="sortable" attribute.%0a* The optional "simpletable" class is available in core skins and possibly other skins, it should define reasonably simple table styles.%0a* The first row of the table needs to have heading cells with %25pmhlt%25 [@||!@]%25%25 separators which can be clicked to order the rows by the column.%0a* If the last row of your table should be a footer that is not sorted, use the class "sortable-footer" instead of "sortable". If you use %25pmhlt%25 [@||!@]%25%25 separators in the footer, they will also allow the rows to be sorted, like the header cells.%0a%0aData types: By default, the rows are sorted numerically, if the cells contain unformatted numeric values, or alphabetically. You can define the sorting data type of a column by adding to the heading cell an empty [[WikiStyle(s)]] element:%0a* %25pmhlt%25@@[=%25sort-numeric-us%25%25%25=]@@ - cells in the column contain US-formatted numbers like @@1,234.56@@.%0a* %25pmhlt%25@@[=%25sort-numeric%25%25%25=]@@ - cells in the column contain SI-formatted numbers like @@1 234,56@@.%0a* %25pmhlt%25@@[=%25sort-date%25%25%25=]@@ - cells in the column contain dates or date-times that will be parsed by the browser. Dates like "2023-11-19" or "2023-11-19 14:09:11" should be correctly parsed, other dates in English might be correctly detected or not.%0a* %25pmhlt%25@@[=%25sort-time%25%25%25=]@@ - the cell contains a %25hlt html%25@@%3ctime datetime="...">%3c/time>@@ element, and its "datetime" value should be used for sorting. Markup like %25pmhlt%25@@[=@2022-01-08T10:07:08Z=]@@ or @@[={(ftime "%25L" "{*$LastModifiedTime}")}=]@@ would output a %3ctime> element in the timezone of the visitor, with more or less precision depending on $EnableLocalTimes, but the "datetime" attributes should allow precise sorting.%0a%0a!! FAQ%0a>>faq%3c%3c [[#faq]]%0aQ: How do I create a basic table? %0aA: Tables are created via use of the double pipe character: @@||@@. Lines beginning with this markup denote rows in a table; within such lines the double-pipe is used to delimit cells. In the examples below a border is added for illustration (the default is no border).%0a%0a(:markup caption='Basic table' class=horiz:)%0a|| border=1 rules=rows frame=hsides%0a|| cell 1 || cell 2 || cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0aQ: How do I create cell headers?%0aA: Header cells can be created by placing ! as the first character of a cell. Note that these are ''table headers'', not ''headings'', so it doesn't extend to !!, !!!, etc.%0a%0a(:markup caption='Table headers' class=horiz:)%0a|| border=1 rules=cols frame=vsides%0a||! cell 1 ||! cell 2 ||! cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0aQ: How do I obtain a table with thin lines and more distance to the content?%0aA: "Thin lines" is tricky and browser dependent, but the following works for Firefox and IE (Nov. 2009):%0a%0a(:markup caption='Thin lines and cell padding' class=horiz:)%0a||border="1" style="border-collapse:collapse" cellpadding="5" width=66%25%0a||!Header ||! Header || '''Header'''||%0a||cells || with || padding||%0a|| || || ||%0a(:markupend:)%0a%0aQ: How do I create an advanced table? %0aA: See [[PmWiki.TableDirectives | table directives]]%0a%0aQ: My tables are by default centered. When I try to use '||align=left' they don't align left as expected. %0aA: Use ||style="margin-left:0px;" instead. %0a%0aQ: How can I specify the width of columns?%0aA: You can define the widths via custom styles, see Cookbook:FormattingTables and $TableCellAttrFmt. Add in config.php :%0a[@$TableCellAttrFmt = 'class=col$TableCellCount';@]%0a-> And add in pub/css/local.css : %0a[@%0atable.column td.col1 { width: 120px; }%0atable.column td.col3 { width: 40px; }%0a@]%0a%0aQ: How can I display a double pipe "||" in cell text using basic table markup?%0aA: Escape it with [@[=||=]@] to display || unchanged.%0a%0aQ: How do I apply styles to the elements of the table, like an ID to the table row, or a class/style to the TD?%0aA: See [[PmWiki/WikiStyles#WikiStyleApply | $WikiStyleApply]].%0a%0aAlternately, use [[table directives]], which allow specifying styling either directly (''style="..."'') or by a ''class="..."'' attribute for CSS.%0a%0aQ: Is there a simple way to change the table defaults? I prefer a border and I'm tired of adding it to every table.%0aA: You can set %25hlt php%25 @@$SimpleTableDefaultClassName = 'simpletable';@@ and/or define your own styles in your stylesheet. The "simpletable" class is available in the core skins, and can be redefined or overridden in pub/css/local.css.%0a -time=1706007521 +text=(:Audience: authors (basic) :)%0a(:Summary:Simple tables with double pipe markup, one row per line:)%0a%0aPmWiki has two types of table markup; the markup described in this page is useful for creating ''simple'' tables with lots of small cells, while [[table directive markup->table directives]] helps with larger scale or more complex tables. For more possibilities with formatting simple tables, see [[Cookbook:Rowspan in simple tables]] and [[Cookbook:Formatting tables]].%0a%0a!! Table basics%0aSimple tables are created via use of double pipe characters: %25pmhlt%25@@||@@%25%25. Lines beginning with this markup denote rows in a table or a formatting line. Within table row lines the double-pipe is used to delimit cells. In the examples below a border is added for illustration (the default is no border).%0a%0aThe first line in the markup (initial double bars "%25pmhlt%25@@||@@%25%25") is required. After the double bars, there may be optional formatting commands for the table such as border or width.%0a%0a(:markup caption='Basic table' class=horiz:)%0a|| border=1%0a|| cell 1 || cell 2 || cell 3 ||%0a|| cell 1 || cell 2 ||%0a(:markupend:)%0a%0aHeader cells can be created by placing ! as the first character of a cell. Note that these are ''table headers'', not ''headings'', so it doesn't extend to !!, !!!, etc.%0a%0a(:markup caption='Table with borders and headers' class=horiz:)%0a|| border=1%0a||! cell 1 ||! cell 2 ||! cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0aA table can have a caption, indicated by [@||!caption!||@]. Any caption must appear prior to other rows of the table.%0a%0a(:markup caption='Table caption' class=horiz:)%0a|| border=1%0a||! A special table !||%0a||! cell 1 ||! cell 2 ||! cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0a%0a!! Formatting cell contents%0a%0aCell contents may be aligned left, centered, or aligned right. %0a* To left-align contents, place the cell contents next to the leading %25pmhlt%25@@||@@%25%25.%0a* To center contents, add a space before and after the cell contents.%0a* To right-align contents, place a space before the cell contents and leave the cell contents next to the trailing %25pmhlt%25@@||@@%25%25.%0a%0a(:markup caption='Cell alignments':)%0a|| border=1 width=100%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0a(:markupend:)%0a%0a(:markup caption='Default cell alignments':)%0a|| border=1 width=100%25%0a||!cell default||!cell left ||%0a||default-aligned||left-aligned ||%0a(:markupend:)%0a%0aNote that header and detail cells have different default alignments.%0a%0aTo get a cell to span multiple columns, follow the cell with empty cells:%0a%0a(:markup caption='Column spanning':)%0a|| border=1 width=100%25%0a|| |||| right column ||%0a|| || right two columns ||||%0a|| || middle column || ||%0a|| left column || ||||%0a|| left two columns |||| ||%0a|| entire row ||||||%0a|| left column || middle column || right column ||%0a(:markupend:)%0a%0aTo get a cell to span multiple rows, add '''[@++@]''' after the cell text (2 or more plus characters make the cell span that many rows):%0a%0a(:markup:)%0a|| border=1%0a||Span 3 rows+++ ||Regular cell ||%0a||Cell 2nd column ||%0a||Cell 2nd column ||%0a||Some text || Span 2 rows ++ ||%0a||First column ||%0a(:markupend:)%0a%0aIf a cell text needs to end with 2 or more plus characters, insert the empty space character [@[==]@] after them.%0a%0aTo make the rowspan more visible when editing, you can insert a cell with only caret "^" characters and it will be ignored:%0a%0a(:markup:)%0a|| border=1%0a||Span 3 rows+++ ||Regular cell ||%0a||^^^^^^^^^^^^^^^||Cell 2nd column ||%0a||^^^^^^^^^^^^^^^||Cell 2nd column ||%0a||Some text || Span 2 rows++ ||%0a||First column ||^^^^^^^^^^^^^^^^||%0a(:markupend:)%0a%0a%0a!! Table attributes%0a%0aAny line that begins with %25pmhlt%25@@||@@%25%25 but doesn't have a closing %25pmhlt%25@@||@@%25%25 sets the ''table attributes'' for any tables that follow. These attributes can control the size and position of the table, borders, background color, and cell spacing. (In fact these are just standard HTML attributes that are placed in the %3ctable> tag.)%0a%0aUse the [@width=@] attribute to set a table's width, using either a percentage value, an absolute size, or '''*'''.%0a%0aSee also $SimpleTableDefaultClassName.%0a%0a(:markup caption='Table width':)%0a|| border=1 width=100%25 %0a|| cell 1 || cell 2 || cell 3 ||%0a|| c1 || cellcellcellcell2 || cell 3 ||%0a(:markupend:)%0a%0aThe [@border=@] attribute sets the size of a table's borders.%0a%0a(:markup caption='Bordered table' class=horiz:)%0a|| border=10 width=70%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0a(:markupend:)%0a%0a(:markup caption='Borderless table' class=horiz:)%0a|| border=0 width=70%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0a(:markupend:)%0a%0aUse [@align=center@], [@align=left@], and [@align=right@] to center, left, or right align a table. Note that [@align=left@] and [@align=right@] create a ''floating table'', such that text wraps around the table.%0a%0a(:markup caption='Table alignment: center':)%0a|| border=1 align=center width=50%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0aNotice how text does not wrap with a table using "align=center".%0a(:markupend:)%0a%0a(:markup caption='Table alignment: left':)%0a|| border=1 align=left width=50%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0aNotice how text wraps to the right of a table using "align=left".%0a(:markupend:)%0a%0a(:markup caption='Table alignment: right':)%0a|| border=1 align=right width=50%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-aligned || centered || right-aligned||%0aNotice how text wraps to the left of a table using "align=right".%0a(:markupend:)%0a%0aNote: to get a table to align left (but not "float left") requires CSS, as in%0a->%25pmhlt%25[@||style="margin-left:0px;"@]%0a%0aThe [@bgcolor=@] attribute sets the background color for a table. At present there is no way to specify the color of individual rows or cells in this type of table (but see Cookbook:FormattingTables).%0a%0a(:markup class=horiz:)%0a|| border=1 align=center bgcolor=yellow width=70%25%0a||!cell 1 ||! cell 2 ||! cell 3||%0a||left-align || center || right-align||%0a(:markupend:)%0a%0a!! Sortable tables [[#sortable]]%0aTo allow readers to reorder a table, give it the class="sortable" attribute:%0a(:markup:)%0a|| class="sortable simpletable"%0a||! m||!Geographic zone ||!Highest point ||!Country ||%0a|| 3700||Arctic ||Gunnbjørn Fjeld ||Greenland ||%0a|| 8848||North Temperate Zone ||Mount Everest ||Nepal ||%0a|| 5790||North Tropical Zone ||Cayambe ||Ecuador ||%0a|| 6768||South Tropical Zone ||Huáscarán ||Peru ||%0a|| 6960||South Temperate Zone ||Aconcagua ||Argentina ||%0a|| 4892||Antarctic ||Mount Vinson ||(none) ||%0a(:markupend:)%0a%0aNotes:%0a* This feature has to be enabled in local configuration, see $EnableSortable. It will then work both for simple tables as above, and for [[table directives]] with the class="sortable" attribute.%0a* The optional "simpletable" class is available in core skins and possibly other skins, it should define reasonably simple table styles.%0a* The first row of the table needs to have heading cells with %25pmhlt%25 [@||!@]%25%25 separators which can be clicked to order the rows by the column.%0a* If the last row of your table should be a footer that is not sorted, use the class "sortable-footer" instead of "sortable". If you use %25pmhlt%25 [@||!@]%25%25 separators in the footer, they will also allow the rows to be sorted, like the header cells.%0a%0aData types: By default, the rows are sorted numerically, if the cells contain unformatted numeric values, or alphabetically. You can define the sorting data type of a column by adding to the heading cell an empty [[WikiStyle(s)]] element:%0a* %25pmhlt%25@@[=%25sort-numeric-us%25%25%25=]@@ - cells in the column contain US-formatted numbers like @@1,234.56@@.%0a* %25pmhlt%25@@[=%25sort-numeric%25%25%25=]@@ - cells in the column contain SI-formatted numbers like @@1 234,56@@.%0a* %25pmhlt%25@@[=%25sort-date%25%25%25=]@@ - cells in the column contain dates or date-times that will be parsed by the browser. Dates like "2023-11-19" or "2023-11-19 14:09:11" should be correctly parsed, other dates in English might be correctly detected or not.%0a* %25pmhlt%25@@[=%25sort-time%25%25%25=]@@ - the cell contains a %25hlt html%25@@%3ctime datetime="...">%3c/time>@@ element, and its "datetime" value should be used for sorting. Markup like %25pmhlt%25@@[=@2022-01-08T10:07:08Z=]@@ or @@[={(ftime "%25L" "{*$LastModifiedTime}")}=]@@ would output a %3ctime> element in the timezone of the visitor, with more or less precision depending on $EnableLocalTimes, but the "datetime" attributes should allow precise sorting.%0a%0a!! FAQ%0a>>faq%3c%3c [[#faq]]%0aQ: How do I create a basic table? %0aA: Tables are created via use of the double pipe character: @@||@@. Lines beginning with this markup denote rows in a table; within such lines the double-pipe is used to delimit cells. In the examples below a border is added for illustration (the default is no border).%0a%0a(:markup caption='Basic table' class=horiz:)%0a|| border=1 rules=rows frame=hsides%0a|| cell 1 || cell 2 || cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0aQ: How do I create cell headers?%0aA: Header cells can be created by placing ! as the first character of a cell. Note that these are ''table headers'', not ''headings'', so it doesn't extend to !!, !!!, etc.%0a%0a(:markup caption='Table headers' class=horiz:)%0a|| border=1 rules=cols frame=vsides%0a||! cell 1 ||! cell 2 ||! cell 3 ||%0a|| cell 1 || cell 2 || cell 3 ||%0a(:markupend:)%0a%0aQ: How do I obtain a table with thin lines and more distance to the content?%0aA: "Thin lines" is tricky and browser dependent, but the following works for Firefox and IE (Nov. 2009):%0a%0a(:markup caption='Thin lines and cell padding' class=horiz:)%0a||border="1" style="border-collapse:collapse" cellpadding="5" width=66%25%0a||!Header ||! Header || '''Header'''||%0a||cells || with || padding||%0a|| || || ||%0a(:markupend:)%0a%0aQ: How do I create an advanced table? %0aA: See [[PmWiki.TableDirectives | table directives]]%0a%0aQ: My tables are by default centered. When I try to use '||align=left' they don't align left as expected. %0aA: Use ||style="margin-left:0px;" instead. %0a%0aQ: How can I specify the width of columns?%0aA: You can define the widths via custom styles, see Cookbook:FormattingTables and $TableCellAttrFmt. Add in config.php :%0a[@$TableCellAttrFmt = 'class=col$TableCellCount';@]%0a-> And add in pub/css/local.css : %0a[@%0atable.column td.col1 { width: 120px; }%0atable.column td.col3 { width: 40px; }%0a@]%0a%0aQ: How can I display a double pipe "||" in cell text using basic table markup?%0aA: Escape it with [@[=||=]@] to display || unchanged.%0a%0aQ: How do I apply styles to the elements of the table, like an ID to the table row, or a class/style to the TD?%0aA: See [[PmWiki/WikiStyles#WikiStyleApply | $WikiStyleApply]].%0a%0aAlternately, use [[table directives]], which allow specifying styling either directly (''style="..."'') or by a ''class="..."'' attribute for CSS.%0a%0aQ: Is there a simple way to change the table defaults? I prefer a border and I'm tired of adding it to every table.%0aA: You can set %25hlt php%25 @@$SimpleTableDefaultClassName = 'simpletable';@@ and/or define your own styles in your stylesheet. The "simpletable" class is available in the core skins, and can be redefined or overridden in pub/css/local.css.%0a +time=1723977749 diff --git a/wikilib.d/PmWiki.Upgrades b/wikilib.d/PmWiki.Upgrades index 779e9579..d2192708 100644 --- a/wikilib.d/PmWiki.Upgrades +++ b/wikilib.d/PmWiki.Upgrades @@ -1,10 +1,10 @@ -version=pmwiki-2.3.32 ordered=1 urlencoded=1 +version=pmwiki-2.3.36 ordered=1 urlencoded=1 author=Petko charset=UTF-8 -csum=customized $UnapprovedLinkFmt (+235) +csum=[[Site.EditForm]], sortable, rowspan (+629) name=PmWiki.Upgrades post= Save -rev=116 +rev=118 targets=PmWiki.PmWiki,PmWiki.UpgradingFromPmWiki1,PmWiki.Upgrades,PmWiki.ReleaseNotes,PmWiki.BackupAndRestore,PmWiki.Download,PmWiki.SiteAnalyzer,PmWiki.LocalCustomizations,PmWiki.Troubleshooting,Site.Site,SiteAdmin.SiteAdmin,PmWiki.BasicVariables,PmWiki.WikiWords,PmWiki.EditVariables,PmWiki.Links,PmWiki.PageLists,PmWiki.SkinTemplates,PmWiki.AuthUser,PmWiki.ChangeLog,PmWiki.PageVariables,Site.PageActions,Site.EditForm,Site.PageNotFound,PmWiki.LayoutVariables,Cookbook.PageListMultiTargets,PmWiki.Functions,PmWiki.Version -text=(:Summary:How to upgrade an existing PmWiki installation:)%0a[[PmWiki]] is designed to make it easy to upgrade the PmWiki software without affecting your existing data files or installation. For most upgrades, you simply copy the files in the new release over your existing installation.%0a%0a>>frame padding=5px%3c%3c%0a'''Note for PmWiki 1.0 sites:''' Upgrading from 1.0.x to 2.0 requires more than simply copying the 2.0 software over the 1.0 installation. See [[(PmWiki:)Upgrading From PmWiki 1]] for more details.%0a>>%3c%3c%0a%0a%25commentout-pmwikiorg%25 ''Note: this page may have a more recent version, see PmWiki:Upgrades.''%0a%0a[[#gen]]%0a!! Generic instructions %0a%0a!!! 1. Read the release notes%0aPlease read carefully the [[(PmWiki:)ReleaseNotes]] before performing an upgrade, about the changes between your previous version and the new one. See if there are any significant changes or preparation tasks that must be handled before performing the upgrade.%0a%0a!!! 2. Backup%0aIt's ''always'' a good idea to have a [[(PmWiki:)backup( and Restore)]] copy of your existing PmWiki installation before starting. You can copy the entire directory containing your existing installation, or you can just make copies of the ''wiki.d/'' directory and any other local customization files you may have created (e.g., ''@@config.php@@'', ''@@localmap.txt@@'', etc.).%0a%0a!!! 3. Download and extract%0aDownload the version of PmWiki that you want from the [[(PmWiki:)download]] page.%0a%0aExtract the tar image using @@tar -xvzf ''tgzfile''@@, where ''tgzfile'' is the tar file you downloaded above. This will create a @@pmwiki-x.y.z@@ directory with the new version of the software.%0a%0a!!! 4. Copy%0aCopy the files in @@pmwiki-x.y.z@@ over the files of your existing PmWiki installation. For example, if your existing PmWiki installation is in a directory called ''pmwiki'', then one way to copy the new files over the existing ones is to enter the command:%0a%0a->@@cp -a pmwiki-x.y.z/. pmwiki@@%0a%0aNote that BSD systems will not have the -a option as a command-line argument for ''cp'', but that's okay, since it's just shorthand for ''cp -dpR'', so use that instead of ''-a''.%0a%0aSome environments have an alias established for ''cp'' that enable interactive prompts before overwriting a file. To work around this specify the absolute path to ''cp'', such as ''/bin/cp''.%0a%0aOn (some) [=FreeBSD=] servers and Mac OS X systems you need to use %0a%0a->@@cp -Rpv pmwiki-x.y.z/. pmwiki@@%0a%0aAlternatively, you can use @@rsync@@:%0a%0a->@@rsync --dry-run -ahv --stats pmwiki-x.y.z/ pmwiki/@@%0a%0aThis will perform a trial run with no changes made but will show which files would be updated. To perform the actual update, remove the @@--dry-run@@ option.%0a%0a!!! 5. Update customisations and recipes%0aThat's it! Your base PmWiki installation is complete.%0a%0aNow use the [[PmWiki:Site Analyzer]] to determine which recipes could be updated to the most recent version.%0a%0aUnless you have made customizations to the ''@@pmwiki.php@@'' script or to the files in ''@@scripts/@@'', your PmWiki installation should continue to run correctly! (Changes to these files are {+not+} recommended).%0a%0a([[Local customizations]] should go in ''@@local/config.php@@'', ''@@pub/css@@'', and ''@@pub/skins/@@''@@yourskinname@@)%0a%0a'''Note''': Additional tips can be found on the [[PmWiki:Troubleshooting]] page.%0a%0a%0a[[#v21v22]]%0a!! Upgrading from version 2.1.27 to 2.2.0%0a%0aBetween the stable versions 2.1.27 and 2.2.0 there are a number of additions. Some of them may need changes to local config files or to wiki pages, and they are outlined here. For the full list of changes see [[ReleaseNotes#v220|the release notes]].%0a%0aIf you are upgrading from a 2.2.beta version, your wiki may already include these features.%0a%0a* Some pages that were formerly in the [[Site]].* group are now in a separate read-protected [[SiteAdmin]].* group: @@Site.AuthUser@@, @@Site.AuthList@@, @@Site.NotifyList@@, @@Site.Blocklist@@, and @@Site.ApprovedUrls@@. If upgrading from an earlier version, PmWiki will prompt to automatically copy these pages to their new location if needed. If a site wishes to continue using the old @@Site.*@@ group for these pages, simply set to @@config.php@@ %25hlt php%25@@$SiteAdminGroup = $SiteGroup;@@%0a%0a* To authorize reading or editing in protected areas, the former password @@"nopass"@@ should now be written as @@"@nopass"@@.%0a%0a* [[WikiWords]] are now disabled by default. To re-enable them, set either $LinkWikiWords or $EnableWikiWords to 1.%0a%0a* The $ROSPatterns variable has changed -- replacement strings are no longer passed through %25hlt php%25@@FmtPageName()@@ i.e., it must now be done explicitly.%0a%0a* [[Links|Page links]] inside included pages, sidebars, headers or footers are now treated as relative to the page where they are written, instead of the page where they appear. For example, in @@Site.SideBar@@, always set the group in a wikilink like %25pmhlt%25[@[[Main/HomePage]]@] or with a page variable [@[[{*$Group}/HomePage]]@], because a link [@[[HomePage]]@] will point to a page @@Site.HomePage@@.%0a%0a* [[PageLists]]%0a** Spaces no longer separate wildcard patterns -- use commas. %0a** %25pmhlt%25[@{$PageCount}, {$GroupCount}, {$GroupPageCount}@] variables used in pagelist templates are now [@{$$PageCount}, {$$GroupCount}, {$$GroupPageCount}@].%0a** The directive no longer accepts parameters from urls by default. In order to have it accept such parameters (which was the default in 2.1 and earlier), add a %25pmhlt%25[@request=1@] option to the [@(:pagelist:)@] directive.%0a%0a* [[Skin templates]] are now required to have %25hlt html%25@@%3c!--HTMLHeader-->@@ and @@%3c!--HTMLFooter-->@@ directives. %0a%0a* Authentication using Active Directory is now simplified, see [[PmWiki.AuthUser]].%0a%0a%0a[[#v220]]%0a!! Upgrading from version 2.2.0 to 2.2.145%0a%25commentout-pmwikiorg%25 ''Note: this page may have a more recent version, see PmWiki:Upgrades.''%0a%0aSome additions since version 2.2.0 may need changes to local config files or to wiki pages, and they are outlined here. For the full list of changes see [[ReleaseNotes|release notes]] and [[change log]].%0a%0a* Version 2.2.10: $EnableRelativePageVars was changed to enabled by default, and it affects [[PageVariables]] from included pages, sidebars, headers and footers.%0a** The form %25pmhlt%25[@{*$var}@] refers to "the currently browsed page" while [@{$var}@] without an asterisk refers to "the physical page where the PageVar is written".%0a** %25red%25 Pages that are designed to work on "the currently browsed page" should switch to using %25pmhlt%25[@{*$FullName}@] instead of [@{$FullName}@]. %25%25 Administrators should especially check any customized versions of [[Site.PageActions]], [[Site.EditForm]], [[Site.PageNotFound]], @@SideBar@@ pages, $GroupHeaderFmt, $GroupFooterFmt, [[Page lists]] in sidebars, headers, and footers. See [[Page variables#specialreferences|Special references]].%0a** If your wiki heavily relies on the previous behavior, you can revert to it, see $EnableRelativePageVars.%0a%0a* Version 2.2.35: Important change for international wikis: the %25hlt php%25@@XLPage()@@ function no longer loads encoding scripts such as @@xlpage-utf-8.php@@. When you upgrade, you need to include those scripts from @@config.php@@, before the call to %25hlt php%25@@XLPage()@@: [@%0a include_once("scripts/xlpage-utf-8.php"); # if your wiki uses UTF-8%0a XLPage('bg','PmWikiBg.XLPage');%0a@]%0a%0a%0a[[#v22v23]]%0a!! Upgrading from version 2.2.145 to 2.3.0%0a%25commentout-pmwikiorg%25 ''Note: this page may have a more recent version, see PmWiki:Upgrades.''%0a%0a[[ReleaseNotes#v230|Version 2.3.0]] requires PHP 5.3 or more recent. The new version includes a number of new features, some of which were previously provided by recipes. %0a%0aHere are the things to review when upgrading:%0a%0a* If you previously used Cookbook:PageListMultiTargets, please disable it when you upgrade. The same functionality is now available in the core.%0a* For PHP 8.1, the function %25hlt php%25@@strftime()@@ has been deprecated. PmWiki 2.3.0 provides a replacement function @@PSFT()@@, see PmWiki:Functions#PSFT.%0a* The @@RecentChanges@@ pages now store in the page source the time stamp in a slightly different, and portable international format (easily parsable). When the page is displayed, the new format is automatically converted to the current one ($TimeFmt), so the @@RecentChanges@@ pages will look exactly like before, but the source code will be slightly different. \\%0aIf you have custom $RecentChangesFmt settings, they will be preserved. If you have no custom settings but still prefer the old format, to revert to the old format, add this to @@config.php@@: %25hlt php%25[@%0a# revert to pre-2.3.0 RecentChanges%0a$RecentChangesFmt = array(%0a '$SiteGroup.AllRecentChanges' => %0a '* [[{$Group}.{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]',%0a '$Group.RecentChanges' =>%0a '* [[{$Group}/{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]');%0a@]%0a* The variable $EnableNotSavedWarning is now enabled by default. Add to @@config.php@@ $EnableNotSavedWarning = 0; to disable it. %0a* The core table of contents function ($PmTOC) has had its styles updated, in order to properly indent long sub-headings. Notably, the TOC links now have a @@display:block@@ setting and there are no line breaks between them. If you have previously added custom styles for PmTOC, please review these in case they need updating.%0a%0aSee also [[Release Notes]] for any changes between your previous version and the new one.%0a%0aIf you have any questions or difficulties, please let us know.%0a%0a%0a[[#v22v23]]%0a!! Upgrading from version 2.3.0 to more recent versions%0a%0a!!! [[ReleaseNotes#v2315|2.3.15]] GUI Edit Buttons change [[#guiedit]]%0a%0aPart of these functions were rewritten to avoid 'unsafe inline' JavaScript. While default and most custom buttons should work without change, you should no longer need to url-encode some characters like %25 or add backslashes. If you have such buttons, you may need to update their declarations to strip the extra backslashes. Please contact us if you need assistance.%0a%0a!!! [[ReleaseNotes#v2323|2.3.23]] PmToken [[#pmtoken]]%0a%0aThis version adds a session token to core edit, upload, attributes and other forms. This is a way to mitigate [[Wikipedia:CSRF|CSRF vulnerabilities]].%0a%0aAll core forms and elements have been updated and should work without change. %0a%0aSome installations might encounter the warning "Token invalid or missing" and the changes are not saved. This can be caused by custom edit or upload forms, automated scripts posting to the wiki, AJAX posting text or uploads used by some recipes, or partial upgrades where some core scripts haven't been updated. Most of these should be easy to update -- please check if you're using the latest recipe versions, or report such cases to us.%0a%0aTo update custom forms:%0a%0a* In a form written in wiki markup, include the element %25pmhlt%25[@(:input pmtoken:)@] after the [@(:input form...:)@] directive.%0a%0a* If your script defines the variable $PageUploadFmt, it should now include the element: %25hlt html%25@@[=%3cinput type='hidden' name='\$TokenName' value='\$TokenValue' />=]@@ inside the @@[=%3cform...>=]@@ element.%0a%0aIf you have customized @@$UnapprovedLinkFmt@@, you should update it to include the token argument @@$TokenName=$TokenValue@@ in the link URL, something like @@[=href='{\$PageUrl}?action=approvesites&\$TokenName=\$TokenValue'=]@@.%0a%0aIf you are unable to update your scripts, you can disable the PmToken functionality with this in config.php:%0a%0a%25hlt php%25[@%0a $EnablePmToken = 0; # edit, upload, attributes, approveurls%0a $PmFormEnablePmToken = 0; # PmForm%0a@]%0a%0aIf you have recipes or custom functions that make changes to the wiki, and you want to benefit from the built-in PmToken functions, see [[Functions#pmtoken]].%0a%0a!!! [[ReleaseNotes#v2331|2.3.31]] PrintFmt() [[#PrintFmt]]%0a%0aThe function PrintFmt() was refactored to process markup and wiki pages before outputting HTML headers, which would allow for markup in headers, footers, sidebars included from the skin, and action pages like the Auth form, to configure $HTMLHeaderFmt and $HTMLStylesFmt, and the directives %25pmhlt%25@@[=(:noheader:), (:notitle:), (:noleft:), (:noaction:)=]@@%25%25 to work from these pages. In case your wiki relied on the previous behavior, you can revert to it by adding to config.php:%0a%0a $EnablePrePrintFmt = 0;%0a%0aIf the new default mode is problematic on your wiki, please do let me know.%0a%0a!! FAQ%0a>>faq%3c%3c [[#faq]]%0a%0aQ: How can I determine what version of PmWiki I'm running now?%0aA: See [[version]] - {Version$:Summary}.%0a%0aQ: How can I test a new version of PmWiki on my wiki without changing the prior version used by visitors?%0aA: The easy way to do this is to install the new version in a separate%0adirectory, and for the new version set (in @@local/config.php@@):%0a%25hlt php%25[@%0a $WikiLibDirs = array(&$WikiDir,%0a new PageStore('/path/to/existing/wiki.d/{$FullName}'),%0a new PageStore('wikilib.d/{$FullName}'));%0a%0a@]%0aThis lets you test the new version using existing page content%0awithout impacting the existing site or risking modification of%0athe pages. (Of course, any recipes or local customizations have to%0abe installed in the new version as well.) %0a%0aThen, once you're comfortable that the new version seems to work%0aas well as the old, it's safe to upgrade the old version (and one%0aknows of any configuration or page changes that need to be made).%0a -time=1713687286 +text=(:Summary:How to upgrade an existing PmWiki installation:)%0a[[PmWiki]] is designed to make it easy to upgrade the PmWiki software without affecting your existing data files or installation. For most upgrades, you simply copy the files in the new release over your existing installation.%0a%0a>>frame padding=5px%3c%3c%0a'''Note for PmWiki 1.0 sites:''' Upgrading from 1.0.x to 2.0 requires more than simply copying the 2.0 software over the 1.0 installation. See [[(PmWiki:)Upgrading From PmWiki 1]] for more details.%0a>>%3c%3c%0a%0a%25commentout-pmwikiorg%25 ''Note: this page may have a more recent version, see PmWiki:Upgrades.''%0a%0a[[#gen]]%0a!! Generic instructions %0a%0a!!! 1. Read the release notes%0aPlease read carefully the [[(PmWiki:)ReleaseNotes]] before performing an upgrade, about the changes between your previous version and the new one. See if there are any significant changes or preparation tasks that must be handled before performing the upgrade.%0a%0a!!! 2. Backup%0aIt's ''always'' a good idea to have a [[(PmWiki:)backup( and Restore)]] copy of your existing PmWiki installation before starting. You can copy the entire directory containing your existing installation, or you can just make copies of the ''wiki.d/'' directory and any other local customization files you may have created (e.g., ''@@config.php@@'', ''@@localmap.txt@@'', etc.).%0a%0a!!! 3. Download and extract%0aDownload the version of PmWiki that you want from the [[(PmWiki:)download]] page.%0a%0aExtract the tar image using @@tar -xvzf ''tgzfile''@@, where ''tgzfile'' is the tar file you downloaded above. This will create a @@pmwiki-x.y.z@@ directory with the new version of the software.%0a%0a!!! 4. Copy%0aCopy the files in @@pmwiki-x.y.z@@ over the files of your existing PmWiki installation. For example, if your existing PmWiki installation is in a directory called ''pmwiki'', then one way to copy the new files over the existing ones is to enter the command:%0a%0a->@@cp -a pmwiki-x.y.z/. pmwiki@@%0a%0aNote that BSD systems will not have the -a option as a command-line argument for ''cp'', but that's okay, since it's just shorthand for ''cp -dpR'', so use that instead of ''-a''.%0a%0aSome environments have an alias established for ''cp'' that enable interactive prompts before overwriting a file. To work around this specify the absolute path to ''cp'', such as ''/bin/cp''.%0a%0aOn (some) [=FreeBSD=] servers and Mac OS X systems you need to use %0a%0a->@@cp -Rpv pmwiki-x.y.z/. pmwiki@@%0a%0aAlternatively, you can use @@rsync@@:%0a%0a->@@rsync --dry-run -ahv --stats pmwiki-x.y.z/ pmwiki/@@%0a%0aThis will perform a trial run with no changes made but will show which files would be updated. To perform the actual update, remove the @@--dry-run@@ option.%0a%0a!!! 5. Update customisations and recipes%0aThat's it! Your base PmWiki installation is complete.%0a%0aNow use the [[PmWiki:Site Analyzer]] to determine which recipes could be updated to the most recent version.%0a%0aUnless you have made customizations to the ''@@pmwiki.php@@'' script or to the files in ''@@scripts/@@'', your PmWiki installation should continue to run correctly! (Changes to these files are {+not+} recommended).%0a%0a([[Local customizations]] should go in ''@@local/config.php@@'', ''@@pub/css@@'', and ''@@pub/skins/@@''@@yourskinname@@)%0a%0a'''Note''': Additional tips can be found on the [[PmWiki:Troubleshooting]] page.%0a%0a%0a[[#v21v22]]%0a!! Upgrading from version 2.1.27 to 2.2.0%0a%0aBetween the stable versions 2.1.27 and 2.2.0 there are a number of additions. Some of them may need changes to local config files or to wiki pages, and they are outlined here. For the full list of changes see [[ReleaseNotes#v220|the release notes]].%0a%0aIf you are upgrading from a 2.2.beta version, your wiki may already include these features.%0a%0a* Some pages that were formerly in the [[Site]].* group are now in a separate read-protected [[SiteAdmin]].* group: @@Site.AuthUser@@, @@Site.AuthList@@, @@Site.NotifyList@@, @@Site.Blocklist@@, and @@Site.ApprovedUrls@@. If upgrading from an earlier version, PmWiki will prompt to automatically copy these pages to their new location if needed. If a site wishes to continue using the old @@Site.*@@ group for these pages, simply set to @@config.php@@ %25hlt php%25@@$SiteAdminGroup = $SiteGroup;@@%0a%0a* To authorize reading or editing in protected areas, the former password @@"nopass"@@ should now be written as @@"@nopass"@@.%0a%0a* [[WikiWords]] are now disabled by default. To re-enable them, set either $LinkWikiWords or $EnableWikiWords to 1.%0a%0a* The $ROSPatterns variable has changed -- replacement strings are no longer passed through %25hlt php%25@@FmtPageName()@@ i.e., it must now be done explicitly.%0a%0a* [[Links|Page links]] inside included pages, sidebars, headers or footers are now treated as relative to the page where they are written, instead of the page where they appear. For example, in @@Site.SideBar@@, always set the group in a wikilink like %25pmhlt%25[@[[Main/HomePage]]@] or with a page variable [@[[{*$Group}/HomePage]]@], because a link [@[[HomePage]]@] will point to a page @@Site.HomePage@@.%0a%0a* [[PageLists]]%0a** Spaces no longer separate wildcard patterns -- use commas. %0a** %25pmhlt%25[@{$PageCount}, {$GroupCount}, {$GroupPageCount}@] variables used in pagelist templates are now [@{$$PageCount}, {$$GroupCount}, {$$GroupPageCount}@].%0a** The directive no longer accepts parameters from urls by default. In order to have it accept such parameters (which was the default in 2.1 and earlier), add a %25pmhlt%25[@request=1@] option to the [@(:pagelist:)@] directive.%0a%0a* [[Skin templates]] are now required to have %25hlt html%25@@%3c!--HTMLHeader-->@@ and @@%3c!--HTMLFooter-->@@ directives. %0a%0a* Authentication using Active Directory is now simplified, see [[PmWiki.AuthUser]].%0a%0a%0a[[#v220]]%0a!! Upgrading from version 2.2.0 to 2.2.145%0a%25commentout-pmwikiorg%25 ''Note: this page may have a more recent version, see PmWiki:Upgrades.''%0a%0aSome additions since version 2.2.0 may need changes to local config files or to wiki pages, and they are outlined here. For the full list of changes see [[ReleaseNotes|release notes]] and [[change log]].%0a%0a* Version 2.2.10: $EnableRelativePageVars was changed to enabled by default, and it affects [[PageVariables]] from included pages, sidebars, headers and footers.%0a** The form %25pmhlt%25[@{*$var}@] refers to "the currently browsed page" while [@{$var}@] without an asterisk refers to "the physical page where the PageVar is written".%0a** %25red%25 Pages that are designed to work on "the currently browsed page" should switch to using %25pmhlt%25[@{*$FullName}@] instead of [@{$FullName}@]. %25%25 Administrators should especially check any customized versions of [[Site.PageActions]], [[Site.EditForm]], [[Site.PageNotFound]], @@SideBar@@ pages, $GroupHeaderFmt, $GroupFooterFmt, [[Page lists]] in sidebars, headers, and footers. See [[Page variables#specialreferences|Special references]].%0a** If your wiki heavily relies on the previous behavior, you can revert to it, see $EnableRelativePageVars.%0a%0a* Version 2.2.35: Important change for international wikis: the %25hlt php%25@@XLPage()@@ function no longer loads encoding scripts such as @@xlpage-utf-8.php@@. When you upgrade, you need to include those scripts from @@config.php@@, before the call to %25hlt php%25@@XLPage()@@: [@%0a include_once("scripts/xlpage-utf-8.php"); # if your wiki uses UTF-8%0a XLPage('bg','PmWikiBg.XLPage');%0a@]%0a%0a%0a[[#v22v23]]%0a!! Upgrading from version 2.2.145 to 2.3.0%0a%25commentout-pmwikiorg%25 ''Note: this page may have a more recent version, see PmWiki:Upgrades.''%0a%0a[[ReleaseNotes#v230|Version 2.3.0]] requires PHP 5.3 or more recent. The new version includes a number of new features, some of which were previously provided by recipes. %0a%0aHere are the things to review when upgrading:%0a%0a* If you previously used Cookbook:PageListMultiTargets, please disable it when you upgrade. The same functionality is now available in the core.%0a* For PHP 8.1, the function %25hlt php%25@@strftime()@@ has been deprecated. PmWiki 2.3.0 provides a replacement function @@PSFT()@@, see PmWiki:Functions#PSFT.%0a* The @@RecentChanges@@ pages now store in the page source the time stamp in a slightly different, and portable international format (easily parsable). When the page is displayed, the new format is automatically converted to the current one ($TimeFmt), so the @@RecentChanges@@ pages will look exactly like before, but the source code will be slightly different. \\%0aIf you have custom $RecentChangesFmt settings, they will be preserved. If you have no custom settings but still prefer the old format, to revert to the old format, add this to @@config.php@@: %25hlt php%25[@%0a# revert to pre-2.3.0 RecentChanges%0a$RecentChangesFmt = array(%0a '$SiteGroup.AllRecentChanges' => %0a '* [[{$Group}.{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]',%0a '$Group.RecentChanges' =>%0a '* [[{$Group}/{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]');%0a@]%0a* The variable $EnableNotSavedWarning is now enabled by default. Add to @@config.php@@ $EnableNotSavedWarning = 0; to disable it. %0a* The core table of contents function ($PmTOC) has had its styles updated, in order to properly indent long sub-headings. Notably, the TOC links now have a @@display:block@@ setting and there are no line breaks between them. If you have previously added custom styles for PmTOC, please review these in case they need updating.%0a%0aSee also [[Release Notes]] for any changes between your previous version and the new one.%0a%0aIf you have any questions or difficulties, please let us know.%0a%0a%0a[[#v22v23]]%0a!! Upgrading from version 2.3.0 to more recent versions%0a%0a!!! [[ReleaseNotes#v2315|2.3.15]] GUI Edit Buttons change [[#guiedit]]%0a%0aPart of these functions were rewritten to avoid 'unsafe inline' JavaScript. While default and most custom buttons should work without change, you should no longer need to url-encode some characters like %25 or add backslashes. If you have such buttons, you may need to update their declarations to strip the extra backslashes. Please contact us if you need assistance.%0a%0a!!! [[ReleaseNotes#v2323|2.3.23]] PmToken [[#pmtoken]]%0a%0aThis version adds a session token to core edit, upload, attributes and other forms. This is a way to mitigate [[Wikipedia:CSRF|CSRF vulnerabilities]].%0a%0aAll core forms and elements have been updated and should work without change. %0a%0aSome installations might encounter the warning "Token invalid or missing" and the changes are not saved. This can be caused by custom edit or upload forms, automated scripts posting to the wiki, AJAX posting text or uploads used by some recipes, or partial upgrades where some core scripts haven't been updated. Most of these should be easy to update -- please check if you're using the latest recipe versions, or report such cases to us.%0a%0aTo update custom forms:%0a%0a* In a form written in wiki markup, include the element %25pmhlt%25[@(:input pmtoken:)@] after the [@(:input form...:)@] directive.%0a%0a* If your script defines the variable $PageUploadFmt, it should now include the element: %25hlt html%25@@[=%3cinput type='hidden' name='\$TokenName' value='\$TokenValue' />=]@@ inside the @@[=%3cform...>=]@@ element.%0a%0aIf you have customized @@$UnapprovedLinkFmt@@, you should update it to include the token argument @@$TokenName=$TokenValue@@ in the link URL, something like @@[=href='{\$PageUrl}?action=approvesites&\$TokenName=\$TokenValue'=]@@.%0a%0aIf you are unable to update your scripts, you can disable the PmToken functionality with this in config.php:%0a%0a%25hlt php%25[@%0a $EnablePmToken = 0; # edit, upload, attributes, approveurls%0a $PmFormEnablePmToken = 0; # PmForm%0a@]%0a%0aIf you have recipes or custom functions that make changes to the wiki, and you want to benefit from the built-in PmToken functions, see [[Functions#pmtoken]].%0a%0a!!! [[ReleaseNotes#v2331|2.3.31]] PrintFmt() [[#PrintFmt]]%0a%0aThe function PrintFmt() was refactored to process markup and wiki pages before outputting HTML headers, which would allow for markup in headers, footers, sidebars included from the skin, and action pages like the Auth form, to configure $HTMLHeaderFmt and $HTMLStylesFmt, and the directives %25pmhlt%25@@[=(:noheader:), (:notitle:), (:noleft:), (:noaction:)=]@@%25%25 to work from these pages. In case your wiki relied on the previous behavior, you can revert to it by adding to config.php:%0a%0a $EnablePrePrintFmt = 0;%0a%0aIf the new default mode is problematic on your wiki, please do let me know.%0a%0a%0a!!! [[ReleaseNotes#v2337|2.3.37]] [[Site.EditForm]], sortable, rowspan [[#v2337]]%0a%0a%25p pmhlt%25The page [[Site.EditForm]] has been modified, if you have customized it, you may want to edit this page and after [@(:input e_minorcheckbox:)@] remove the text "[@$[This is a minor edit]@]". This was needed to allow for the label to be automatically modified in some cases, notably when merging edits.%0a%0a$EnableSortable, and $EnableSimpleTableRowspan are now enabled by default. To disable them, set them to 0 in config.php.%0a%0a $EnableSortable = 0; # disable sortable tables%0a $EnableSimpleTableRowspan = 0; # disable rowspan in tables%0a%0a!! FAQ%0a>>faq%3c%3c [[#faq]]%0a%0aQ: How can I determine what version of PmWiki I'm running now?%0aA: See [[version]] - {Version$:Summary}.%0a%0aQ: How can I test a new version of PmWiki on my wiki without changing the prior version used by visitors?%0aA: The easy way to do this is to install the new version in a separate%0adirectory, and for the new version set (in @@local/config.php@@):%0a%25hlt php%25[@%0a $WikiLibDirs = array(&$WikiDir,%0a new PageStore('/path/to/existing/wiki.d/{$FullName}'),%0a new PageStore('wikilib.d/{$FullName}'));%0a%0a@]%0aThis lets you test the new version using existing page content%0awithout impacting the existing site or risking modification of%0athe pages. (Of course, any recipes or local customizations have to%0abe installed in the new version as well.) %0a%0aThen, once you're comfortable that the new version seems to work%0aas well as the old, it's safe to upgrade the old version (and one%0aknows of any configuration or page changes that need to be made).%0a +time=1724226144 diff --git a/wikilib.d/PmWiki.WebFeeds b/wikilib.d/PmWiki.WebFeeds index 559a59d5..a17ed529 100644 --- a/wikilib.d/PmWiki.WebFeeds +++ b/wikilib.d/PmWiki.WebFeeds @@ -1,9 +1,9 @@ -version=pmwiki-2.3.2 ordered=1 urlencoded=1 -author=MFWolff +version=pmwiki-2.3.36 ordered=1 urlencoded=1 +author=Petko charset=UTF-8 -csum=hlt php (+27) +csum=$EnableFeeds (+178) name=PmWiki.WebFeeds -rev=89 +rev=90 targets=PmWiki.WikiTrails,Site.AllRecentChanges,Cookbook.Backlinks,PmWiki.WikiGroup,PmWiki.Categories,PmWiki.PageLists,Cookbook.RssFeedDisplay,PmWiki.LocalCustomizations,Cookbook.FeedLinks,PmWiki.PagelistVariables,Cookbook.PageFeed,Cookbook.CustomRecentChanges,PmWiki.LayoutVariables,PITS.01161 -text=(:Summary:Web feed notification of changes:)%0a(:Audience: visitors (intermediate) :)%0aWeb feeds are a convenient mechanism to let visitors be notified of changes to a site. Instead of repeatedly checking [=RecentChanges=] every day to see what is new, a visitor can use a [[news aggregator -> Wikipedia:Aggregator]] to quickly see what pages of interest have changed on a site. Web feeds are commonly recognized by terms such as [[(Wikipedia:)RSS]], [[(Wikipedia:)Atom(_%2528standard%2529)]], and ''[[Wikipedia:web_syndication | web syndication]]''. They are also the foundation for podcasting.%0a%0a!! Based on WikiTrails%0aIn its simplest form, web feeds in PmWiki are built on [[WikiTrails]]. Using a feed action such as [@?action=rss@] or [@?action=atom@] on a trail generates a web feed (often called a "channel") where each page on the trail is an item in the feed. Since the RecentChanges and [[{$SiteGroup}.AllRecentChanges]] pages are effectively trails, one can easily get an RSS feed for a group or site by simply adding [@?action=rss@] to the url for a RecentChanges page. For example, to get the site feed for pmwiki.org, one would use%0a%0a->https://pmwiki.org/wiki/Site/AllRecentChanges?action=rss%0a%0aAuthors can also create custom feeds by simply creating a wiki trail of the pages they want included in the feed. Feeds can also be generated from [[groups -> WikiGroup]], [[categories]], and %25newwin%25[[Cookbook:Backlinks|backlinks]], and the order and number of items in the feed can be changed using options in the feed url. Thus, one can obtain a feed for the ''Skins'' category (sorted with most recent items first) by using%0a%0a->https://pmwiki.org/wiki/Category/Skins?action=rss&order=-time%0a%0aPmWiki is able to generate feeds in many formats, including RSS 2.0 ([@?action=rss@]), Atom 1.0 ([@?action=atom@]), and RSS 1.0 ([@?action=rdf@]). In addition, although it is not normally considered a web feed, PmWiki can generate metadata information using the Dublin Core Metadata extensions ([@?action=dc@]).%0a%0a!!How to read a PmWiki syndicated feed%0a%0a# You'll need a [[news aggregator -> Wikipedia:List_of_feed_aggregators]], which is a piece of software designed to read news feeds. Many different news aggregators are available. Some run on your own computer, either on their own or as plugins for email clients, web browsers, or newsreaders. Others are web applications that you can use from any Internet-connected computer. Some are in between (technically web applications, but ones designed to run on your computer, not some remote server). Get one that you like.%0a# Subscribe to the [[WikiTrail(s)]] you desire by supplying the feed url to the aggregator. The feed url will be the name of a trail page with [@?action=rss@] or [@?action=atom@] added to the end of the url.%0a%0a!!Feed options%0a%0aAdd any of the following options to the end of a PmWiki web feed url to change its output (basically any [[pagelist->PageLists]] option is available for web feeds):%0a%0a:?count=''n'': Limit feed to ''n'' items (default 10)%0a:?order=-time : Display most recently changed items first (default: the order of the trail, or by name; in RecentChanges pages the trail is already ordered by -time)%0a:?trail=''page'': Obtain items from trail on ''page'' (default: the trail on the current page)%0a:?group=''group'': Limit feed to pages in ''group''%0a:?name=''name'': Limit feed to pages with specific ''name''%0a:?link=''page'': Create feed from pages linked to ''page''%0a:?list=normal: Exclude things like RecentChanges, AllRecentChanges, etc.%0a%0a%25audience%25 authors (intermediate)%0a!!Configure PmWiki for feeds%0a%0aThis section describes how to syndicate portions of a wiki to appear in a web feed. It does not describe how to display a web feed within a wiki page -- for that, see Cookbook:RssFeedDisplay.%0a%0aTo enable web feed generation for a site, add one or more of the following to a [[local customization(s)]] file:%0a%0a->%25hlt php%25[@%0aif ($action == 'rss') include_once("$FarmD/scripts/feeds.php");%0aif ($action == 'atom') include_once("$FarmD/scripts/feeds.php");%0aif ($action == 'rdf') include_once("$FarmD/scripts/feeds.php");%0aif ($action == 'dc') include_once("$FarmD/scripts/feeds.php");%0a@]%0a%0aor you can combine multiple feeds into a single expression using "||" to separate each feed type. For example, if you want to enable RSS and Atom feeds you would use%0a%0a->%25hlt php%25[@%0aif ($action == 'rss' ||%0a $action == 'atom' ||%0a $action == 'rdf' ||%0a $action == 'dc') include_once("$FarmD/scripts/feeds.php");%0a@]%0a%0a!!Configure feed content%0aWeb feeds are highly configurable, new elements can be easily added to feeds via the $FeedFmt array. Elements in $FeedFmt look like%0a%0a->%25hlt php%25[@$FeedFmt['atom']['feed']['rights'] = 'All Rights Reserved';@]%0a%0awhere the first index corresponds to the action (?action=atom), the second index indicates a per-feed or per-item element, and%0athe third index is the name of the element being generated. The above setting would therefore generate a "%3crights>All Rights Reserved%3c/rights>" in the feed for ?action=atom.%0a%0a[[#pitfall1]]%0aIf the value of an entry begins with a '%3c', then @@feeds.php@@ doesn't automatically add the tag around it. Elements can also be callable functions which are called to generate the appropriate output. See [[https://blogs.law.harvard.edu/tech/rss | RSS specification]] or other feed specifications for what feed content you can use.%0a%0aYou can also change an existing element rather than add a new one. You can use the following lines to ensure that changes made to the wiki will be picked up by some RSS readers that wouldn't otherwise "notice" a page has been changed:%0a%0a->%25hlt php%25[@%0a# Change the link URL when an item is edited.%0a$FeedFmt['rss']['item']['link'] = '{$PageUrl}?when=$ItemISOTime';%0a$FeedFmt['atom']['item']['link'] =%0a "%3clink rel=\"alternate\" href=\"{\$PageUrl}?when=\$ItemISOTime\" />\n";%0a@]%0a%0a%0a!!See Also%0a%0a* [[Cookbook:FeedLinks]] - Add HTML %3chead> links for auto-discovery of your feeds.%0a* [[WikiTrails]]%0a* Wikipedia:Web_feed, Wikipedia:Web_syndication, Wikipedia:RSS, Wikipedia:Atom_%2528standard%2529%0a%0a!! FAQ%0a>>faq%3c%3c [[#faq]]%0a%0aQ: How do I include text from the page (whole page, or first X characters) in the feed body? (note: markup NOT digested)%0a%0a->%25hlt php%25[@function MarkupExcerpt($pagename) {%0a $page = RetrieveAuthPage($pagename, 'read', false);%0a return substr(@$page['text'], 0, 200);%0a}%0a%0a$FmtPV['$MarkupExcerpt'] = 'MarkupExcerpt($pn)';%0a$FeedFmt['rss']['item']['description'] = '$MarkupExcerpt';@]%0a%0a%25green%25 Does this mean if I want to include the time in the rss title and "summary" to rss body I call [@$FeedFmt@] twice like so:%0a->%25hlt php%25[@$FeedFmt['rss']['item']['description'] = '$LastSummary'; %0a$FeedFmt['rss']['item']['title'] = '{$Group} / {$Title} @ $ItemISOTime';@] %0a%0a-->From mailing list Feb 13,2007, a response by Pm: Yes%0a%0aQ: How can I use the RSS %3cenclosure> tag for podcasting?%0a%0aA: For podcasting of mp3 files, simply attach an mp3 file to the page%0awith the same name as the page (i.e., for a page named Podcast.Episode4,%0aone would attach to that page a file named "Episode4.mp3"). The%0afile is automatically picked up by ?action=rss and used as an%0aenclosure.%0a%0aThe set of potential enclosures is given by the $RSSEnclosureFmt%0aarray, thus%0a%0a->%25hlt php%25[@$RSSEnclosureFmt = array('{$Name}.mp3', '{$Name}.wma', '{$Name}.ogg');@]%0a%0aallows podcasting in mp3, wma, and ogg formats.%0a%0a%0aQ: [[#AddSummary]] How to add "summary" to the title in a rss feed (ie. with [@?action=rss@])?%0a%0aA: Add this line in your [@local/config.php@]%0a%0a->%25hlt php%25[@$FeedFmt['rss']['item']['title'] = '{$Group} / {$Title} : $LastModifiedSummary';@]%0a%0a%0aQ: [[#AddDescriptionSummary]] How to add "description" to the title in an rss feed, and summary to the body?%0a%0aA: Add these lines to your [@local/config.php@]%0a%0a->%25hlt php%25[@$FeedFmt['rss']['item']['title'] = '{$Group} / {$Title} : {$Description}';@]%0a->%25hlt php%25[@$FeedFmt['rss']['item']['description'] = '$LastModifiedSummary';@]%0a%0a%0a'''NOTES:'''%0a* you need to replicate these lines for each type (atom, rdf, dc) of feed you provide.%0a* the RSS '''[@description@]'''-tag is not equivalent to the pmWiki ''[@$Description@]'' variable, despite the confusing similarity.%0a%0aQ: Some of my password-protected pages aren't appearing in the feed... how do I work around this?%0a%0aA: From a similar question on the newsgroup, Pm's reply:%0a%0aThe last time I checked, RSS and other syndication protocols didn't%0areally have a well-established interface or mechanism for performing%0aaccess control (i.e., authentication). As far as I know this is%0astill the case.%0a%0aPmWiki's WebFeeds capability is built on top of pagelists, so it%0acould simply be that the $EnablePageListProtect option is preventing%0athe updated pages from appearing in the feed. You might try%0asetting $EnablePageListProtect=0; and see if the password-protected%0apages start appearing in the RSS feed.%0a%0aThe "downside" to setting $EnablePageListProtect to zero is that%0aanyone doing a search on your site will see the existence of the%0apages in the locked section. They won't be able to read any of%0athem, but they'll know they are there!%0a%0aYou could also set $EnablePageListProtect to zero only if ?action=rss:%0a%0a->%25hlt php%25[@if ($action == 'rss') $EnablePageListProtect = 0;@]%0a%0aThis limits the ability to see the protected pages to RSS feeds;%0anormal pagelists and searches wouldn't see them.%0a%0aLastly, it's also possible to configure the webfeeds to obtain%0athe authentication information from the url directly, as in:%0a%0a .../Site/AllRecentChanges?action=rss&authpw=secret%0a%0aThe big downside to this is that the cleartext password will%0aend up traveling across the net with every RSS request, and%0amay end up being recorded in Apache's access logs.%0a%0aQ: How to add feed image?%0a%0aA: Add the following to ''local/config.php'' (this example is for [@?action=rss@]):%0a%0a->%25hlt php%25[@%0a$FeedFmt['rss']['feed']['image'] =%0a" %3ctitle>Logo title%3c/title>%0a %3clink>https://example.com/%3c/link>%0a %3curl>https://example.com/images/logo.gif%3c/url>%0a %3cwidth>120%3c/width>%0a %3cheight>60%3c/height>";%0a@]%0a%0a-> %25red%25Do not forget NOT to start with a '%3c' as there would be no %3cimage> tag around this... See [[#pitfall1|here]].%0a%0aQ: How do I insert RSS news feeds into PmWiki pages?%0a%0aA: See [[Cookbook:RssFeedDisplay]].%0a%0aQ: How can I specify default feed options in a configuration file instead of always placing them in the url?%0aA: For example, if you want [@?action=rss@] to default to [@?action=rss&group=News&order=-time&count=10@], try the following in a [[local customization(s)]] file:%0a%0a->%25hlt php%25[@%0a if ($action == 'rss')%0a SDVA($_REQUEST, array(%0a 'group' => 'News',%0a 'order' => '-time',%0a 'count' => 10));%0a@]%0a%0aQ: Are there ways to let people easily subscribe to a feed?%0a%0aA: On some browsers (Mozilla Firefox), the visitor can see an orange RSS icon in the address bar, and subscribe to the feed by clicking on it. To enable the RSS icon, add this to config.php :%0a%25hlt php%25[@%0a$HTMLHeaderFmt['feedlinks'] = '%3clink rel="alternate" type="application/rss+xml" %0a title="$WikiTitle" href="$ScriptUrl?n=Site.AllRecentChanges&action=rss" />%0a%3clink rel="alternate" type="application/atom+xml" title="$WikiTitle"%0a href="$ScriptUrl?n=Site.AllRecentChanges&action=atom" />';@]%0a%0aYou can also add such a link, for example in your SideBar, @@[=[[Site.AllRecentChanges?action=atom | Subscribe to feed]]=]@@. %0a%0aQ: Can I create an RSS feed for individual page histories?%0aA: See Cookbook:PageFeed.%0a%0a%0aQ: How do I create a custom FeedPage similar to RecentChanges or AllRecentChanges, but with only certain groups or pages recorded?%0aA: See Cookbook:CustomRecentChanges. In a nutshell, you'll declare a $RecentChangesFmt variable with your dedicated FeedPage, and then wrap it in a condition of your choice. For example:%0a%25hlt php%25[@%0a if (PageVar($pagename, '$Group')!='ForbiddenGroup') {%0a $RecentChangesFmt['Site.MyFeedPage'] =%0a '* [[{$FullName}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a }%0a@]%0a%0aQ: How can I update my RSS feed to show every edit for pages on that feed, not just new pages added to the feed?%0aA: Add unique guid links for each edit to your to config.php file (see PITS [[PITS:01161|entry]]):%0a%25hlt php%25[@%0a $FeedFmt['rss']['item']['guid'] = '{$PageUrl}?guid=$ItemISOTime';%0a@]%0a%0aA: Alternatively, you can create the option for edit monitoring by adding a qualifier for RSS links. This allows the user to choose between default ''new pages'' RSS feeds and ''new edits'' RSS feeds (pmwiki.org has this option enabled).%0a%25hlt php%25[@%0a ## For new pages updates: https://example.com/wiki/HomePage?action=rss%0a ## For edits updates: https://example.com/wiki/HomePage?action=rss&edits=1%0a if(@$_REQUEST['edits'] && $action == 'rss')%0a $FeedFmt['rss']['item']['guid'] = '{$PageUrl}?guid=$ItemISOTime';%0a@] -time=1646120102 +text=(:Summary:Web feed notification of changes:)%0a(:Audience: visitors (intermediate) :)%0aWeb feeds are a convenient mechanism to let visitors be notified of changes to a site. Instead of repeatedly checking [=RecentChanges=] every day to see what is new, a visitor can use a [[news aggregator -> Wikipedia:Aggregator]] to quickly see what pages of interest have changed on a site. Web feeds are commonly recognized by terms such as [[(Wikipedia:)RSS]], [[(Wikipedia:)Atom(_%2528standard%2529)]], and ''[[Wikipedia:web_syndication | web syndication]]''. They are also the foundation for podcasting.%0a%0a!! Based on WikiTrails%0aIn its simplest form, web feeds in PmWiki are built on [[WikiTrails]]. Using a feed action such as [@?action=rss@] or [@?action=atom@] on a trail generates a web feed (often called a "channel") where each page on the trail is an item in the feed. Since the RecentChanges and [[{$SiteGroup}.AllRecentChanges]] pages are effectively trails, one can easily get an RSS feed for a group or site by simply adding [@?action=rss@] to the url for a RecentChanges page. For example, to get the site feed for pmwiki.org, one would use%0a%0a->https://pmwiki.org/wiki/Site/AllRecentChanges?action=rss%0a%0aAuthors can also create custom feeds by simply creating a wiki trail of the pages they want included in the feed. Feeds can also be generated from [[groups -> WikiGroup]], [[categories]], and %25newwin%25[[Cookbook:Backlinks|backlinks]], and the order and number of items in the feed can be changed using options in the feed url. Thus, one can obtain a feed for the ''Skins'' category (sorted with most recent items first) by using%0a%0a->https://pmwiki.org/wiki/Category/Skins?action=rss&order=-time%0a%0aPmWiki is able to generate feeds in many formats, including RSS 2.0 ([@?action=rss@]), Atom 1.0 ([@?action=atom@]), and RSS 1.0 ([@?action=rdf@]). In addition, although it is not normally considered a web feed, PmWiki can generate metadata information using the Dublin Core Metadata extensions ([@?action=dc@]).%0a%0a!!How to read a PmWiki syndicated feed%0a%0a# You'll need a [[news aggregator -> Wikipedia:List_of_feed_aggregators]], which is a piece of software designed to read news feeds. Many different news aggregators are available. Some run on your own computer, either on their own or as plugins for email clients, web browsers, or newsreaders. Others are web applications that you can use from any Internet-connected computer. Some are in between (technically web applications, but ones designed to run on your computer, not some remote server). Get one that you like.%0a# Subscribe to the [[WikiTrail(s)]] you desire by supplying the feed url to the aggregator. The feed url will be the name of a trail page with [@?action=rss@] or [@?action=atom@] added to the end of the url.%0a%0a!!Feed options%0a%0aAdd any of the following options to the end of a PmWiki web feed url to change its output (basically any [[pagelist->PageLists]] option is available for web feeds):%0a%0a:?count=''n'': Limit feed to ''n'' items (default 10)%0a:?order=-time : Display most recently changed items first (default: the order of the trail, or by name; in RecentChanges pages the trail is already ordered by -time)%0a:?trail=''page'': Obtain items from trail on ''page'' (default: the trail on the current page)%0a:?group=''group'': Limit feed to pages in ''group''%0a:?name=''name'': Limit feed to pages with specific ''name''%0a:?link=''page'': Create feed from pages linked to ''page''%0a:?list=normal: Exclude things like RecentChanges, AllRecentChanges, etc.%0a%0a%25audience%25 authors (intermediate)%0a!!Configure PmWiki for feeds%0a%0aThis section describes how to syndicate portions of a wiki to appear in a web feed. It does not describe how to display a web feed within a wiki page -- for that, see Cookbook:RssFeedDisplay.%0a%0aTo enable web feed generation for a site, add one or more of the following to a [[local customization(s)]] file:%0a%0a'''PmWiki 2.2.37 or newer:'''%0a->%25hlt php%25[@%0a$EnableFeeds['rss'] = 1;%0a$EnableFeeds['atom'] = 1;%0a$EnableFeeds['rdf'] = 1;%0a$EnableFeeds['dc'] = 1;%0a@]%0a%0a'''PmWiki 2.2.36 or older:'''%0a->%25hlt php%25[@%0aif ($action == 'rss') include_once("$FarmD/scripts/feeds.php");%0aif ($action == 'atom') include_once("$FarmD/scripts/feeds.php");%0aif ($action == 'rdf') include_once("$FarmD/scripts/feeds.php");%0aif ($action == 'dc') include_once("$FarmD/scripts/feeds.php");%0a@]%0a%0aor you can combine multiple feeds into a single expression using "||" to separate each feed type. For example, if you want to enable RSS and Atom feeds you would use%0a%0a->%25hlt php%25[@%0aif ($action == 'rss' ||%0a $action == 'atom' ||%0a $action == 'rdf' ||%0a $action == 'dc') include_once("$FarmD/scripts/feeds.php");%0a@]%0a%0a!!Configure feed content%0aWeb feeds are highly configurable, new elements can be easily added to feeds via the $FeedFmt array. Elements in $FeedFmt look like%0a%0a->%25hlt php%25[@$FeedFmt['atom']['feed']['rights'] = 'All Rights Reserved';@]%0a%0awhere the first index corresponds to the action (?action=atom), the second index indicates a per-feed or per-item element, and%0athe third index is the name of the element being generated. The above setting would therefore generate a "%3crights>All Rights Reserved%3c/rights>" in the feed for ?action=atom.%0a%0a[[#pitfall1]]%0aIf the value of an entry begins with a '%3c', then @@feeds.php@@ doesn't automatically add the tag around it. Elements can also be callable functions which are called to generate the appropriate output. See [[https://blogs.law.harvard.edu/tech/rss | RSS specification]] or other feed specifications for what feed content you can use.%0a%0aYou can also change an existing element rather than add a new one. You can use the following lines to ensure that changes made to the wiki will be picked up by some RSS readers that wouldn't otherwise "notice" a page has been changed:%0a%0a->%25hlt php%25[@%0a# Change the link URL when an item is edited.%0a$FeedFmt['rss']['item']['link'] = '{$PageUrl}?when=$ItemISOTime';%0a$FeedFmt['atom']['item']['link'] =%0a "%3clink rel=\"alternate\" href=\"{\$PageUrl}?when=\$ItemISOTime\" />\n";%0a@]%0a%0a%0a!!See Also%0a%0a* [[Cookbook:FeedLinks]] - Add HTML %3chead> links for auto-discovery of your feeds.%0a* [[WikiTrails]]%0a* Wikipedia:Web_feed, Wikipedia:Web_syndication, Wikipedia:RSS, Wikipedia:Atom_%2528standard%2529%0a%0a!! FAQ%0a>>faq%3c%3c [[#faq]]%0a%0aQ: How do I include text from the page (whole page, or first X characters) in the feed body? (note: markup NOT digested)%0a%0a->%25hlt php%25[@function MarkupExcerpt($pagename) {%0a $page = RetrieveAuthPage($pagename, 'read', false);%0a return substr(@$page['text'], 0, 200);%0a}%0a%0a$FmtPV['$MarkupExcerpt'] = 'MarkupExcerpt($pn)';%0a$FeedFmt['rss']['item']['description'] = '$MarkupExcerpt';@]%0a%0a%25green%25 Does this mean if I want to include the time in the rss title and "summary" to rss body I call [@$FeedFmt@] twice like so:%0a->%25hlt php%25[@$FeedFmt['rss']['item']['description'] = '$LastSummary'; %0a$FeedFmt['rss']['item']['title'] = '{$Group} / {$Title} @ $ItemISOTime';@] %0a%0a-->From mailing list Feb 13,2007, a response by Pm: Yes%0a%0aQ: How can I use the RSS %3cenclosure> tag for podcasting?%0a%0aA: For podcasting of mp3 files, simply attach an mp3 file to the page%0awith the same name as the page (i.e., for a page named Podcast.Episode4,%0aone would attach to that page a file named "Episode4.mp3"). The%0afile is automatically picked up by ?action=rss and used as an%0aenclosure.%0a%0aThe set of potential enclosures is given by the $RSSEnclosureFmt%0aarray, thus%0a%0a->%25hlt php%25[@$RSSEnclosureFmt = array('{$Name}.mp3', '{$Name}.wma', '{$Name}.ogg');@]%0a%0aallows podcasting in mp3, wma, and ogg formats.%0a%0a%0aQ: [[#AddSummary]] How to add "summary" to the title in a rss feed (ie. with [@?action=rss@])?%0a%0aA: Add this line in your [@local/config.php@]%0a%0a->%25hlt php%25[@$FeedFmt['rss']['item']['title'] = '{$Group} / {$Title} : $LastModifiedSummary';@]%0a%0a%0aQ: [[#AddDescriptionSummary]] How to add "description" to the title in an rss feed, and summary to the body?%0a%0aA: Add these lines to your [@local/config.php@]%0a%0a->%25hlt php%25[@$FeedFmt['rss']['item']['title'] = '{$Group} / {$Title} : {$Description}';@]%0a->%25hlt php%25[@$FeedFmt['rss']['item']['description'] = '$LastModifiedSummary';@]%0a%0a%0a'''NOTES:'''%0a* you need to replicate these lines for each type (atom, rdf, dc) of feed you provide.%0a* the RSS '''[@description@]'''-tag is not equivalent to the pmWiki ''[@$Description@]'' variable, despite the confusing similarity.%0a%0aQ: Some of my password-protected pages aren't appearing in the feed... how do I work around this?%0a%0aA: From a similar question on the newsgroup, Pm's reply:%0a%0aThe last time I checked, RSS and other syndication protocols didn't%0areally have a well-established interface or mechanism for performing%0aaccess control (i.e., authentication). As far as I know this is%0astill the case.%0a%0aPmWiki's WebFeeds capability is built on top of pagelists, so it%0acould simply be that the $EnablePageListProtect option is preventing%0athe updated pages from appearing in the feed. You might try%0asetting $EnablePageListProtect=0; and see if the password-protected%0apages start appearing in the RSS feed.%0a%0aThe "downside" to setting $EnablePageListProtect to zero is that%0aanyone doing a search on your site will see the existence of the%0apages in the locked section. They won't be able to read any of%0athem, but they'll know they are there!%0a%0aYou could also set $EnablePageListProtect to zero only if ?action=rss:%0a%0a->%25hlt php%25[@if ($action == 'rss') $EnablePageListProtect = 0;@]%0a%0aThis limits the ability to see the protected pages to RSS feeds;%0anormal pagelists and searches wouldn't see them.%0a%0aLastly, it's also possible to configure the webfeeds to obtain%0athe authentication information from the url directly, as in:%0a%0a .../Site/AllRecentChanges?action=rss&authpw=secret%0a%0aThe big downside to this is that the cleartext password will%0aend up traveling across the net with every RSS request, and%0amay end up being recorded in Apache's access logs.%0a%0aQ: How to add feed image?%0a%0aA: Add the following to ''local/config.php'' (this example is for [@?action=rss@]):%0a%0a->%25hlt php%25[@%0a$FeedFmt['rss']['feed']['image'] =%0a" %3ctitle>Logo title%3c/title>%0a %3clink>https://example.com/%3c/link>%0a %3curl>https://example.com/images/logo.gif%3c/url>%0a %3cwidth>120%3c/width>%0a %3cheight>60%3c/height>";%0a@]%0a%0a-> %25red%25Do not forget NOT to start with a '%3c' as there would be no %3cimage> tag around this... See [[#pitfall1|here]].%0a%0aQ: How do I insert RSS news feeds into PmWiki pages?%0a%0aA: See [[Cookbook:RssFeedDisplay]].%0a%0aQ: How can I specify default feed options in a configuration file instead of always placing them in the url?%0aA: For example, if you want [@?action=rss@] to default to [@?action=rss&group=News&order=-time&count=10@], try the following in a [[local customization(s)]] file:%0a%0a->%25hlt php%25[@%0a if ($action == 'rss')%0a SDVA($_REQUEST, array(%0a 'group' => 'News',%0a 'order' => '-time',%0a 'count' => 10));%0a@]%0a%0aQ: Are there ways to let people easily subscribe to a feed?%0a%0aA: On some browsers (Mozilla Firefox), the visitor can see an orange RSS icon in the address bar, and subscribe to the feed by clicking on it. To enable the RSS icon, add this to config.php :%0a%25hlt php%25[@%0a$HTMLHeaderFmt['feedlinks'] = '%3clink rel="alternate" type="application/rss+xml" %0a title="$WikiTitle" href="$ScriptUrl?n=Site.AllRecentChanges&action=rss" />%0a%3clink rel="alternate" type="application/atom+xml" title="$WikiTitle"%0a href="$ScriptUrl?n=Site.AllRecentChanges&action=atom" />';@]%0a%0aYou can also add such a link, for example in your SideBar, @@[=[[Site.AllRecentChanges?action=atom | Subscribe to feed]]=]@@. %0a%0aQ: Can I create an RSS feed for individual page histories?%0aA: See Cookbook:PageFeed.%0a%0a%0aQ: How do I create a custom FeedPage similar to RecentChanges or AllRecentChanges, but with only certain groups or pages recorded?%0aA: See Cookbook:CustomRecentChanges. In a nutshell, you'll declare a $RecentChangesFmt variable with your dedicated FeedPage, and then wrap it in a condition of your choice. For example:%0a%25hlt php%25[@%0a if (PageVar($pagename, '$Group')!='ForbiddenGroup') {%0a $RecentChangesFmt['Site.MyFeedPage'] =%0a '* [[{$FullName}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';%0a }%0a@]%0a%0aQ: How can I update my RSS feed to show every edit for pages on that feed, not just new pages added to the feed?%0aA: Add unique guid links for each edit to your to config.php file (see PITS [[PITS:01161|entry]]):%0a%25hlt php%25[@%0a $FeedFmt['rss']['item']['guid'] = '{$PageUrl}?guid=$ItemISOTime';%0a@]%0a%0aA: Alternatively, you can create the option for edit monitoring by adding a qualifier for RSS links. This allows the user to choose between default ''new pages'' RSS feeds and ''new edits'' RSS feeds (pmwiki.org has this option enabled).%0a%25hlt php%25[@%0a ## For new pages updates: https://example.com/wiki/HomePage?action=rss%0a ## For edits updates: https://example.com/wiki/HomePage?action=rss&edits=1%0a if(@$_REQUEST['edits'] && $action == 'rss')%0a $FeedFmt['rss']['item']['guid'] = '{$PageUrl}?guid=$ItemISOTime';%0a@] +time=1724043632 diff --git a/wikilib.d/Site.EditForm b/wikilib.d/Site.EditForm index c0e9d4b2..3e473cfe 100644 --- a/wikilib.d/Site.EditForm +++ b/wikilib.d/Site.EditForm @@ -1,10 +1,10 @@ -version=pmwiki-2.2.30 ordered=1 urlencoded=1 -agent=Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0 +version=pmwiki-2.3.36 ordered=1 urlencoded=1 +agent=Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0 author=Petko charset=UTF-8 -csum= +host=127.0.0.1 name=Site.EditForm -rev=61 +rev=62 targets= -text=(:Summary:contains the edit page layout form:)%0a!! $[Editing {*$FullName}] %25block class=wikiaction%25%0a(:messages:)%0a(:div id='wikiedit':)%0a(:input e_form:)[[#top]](:e_guibuttons:)\\%0a(:input e_textarea:)\\%0a$[Summary]: (:input e_changesummary:)\\%0a$[Author]: (:input e_author:) (:input e_minorcheckbox:) $[This is a minor edit]\\%0a(:input e_savebutton:) (:input e_savedraftbutton:) (:input e_saveeditbutton:) (:input e_previewbutton:) (:input e_cancelbutton:)%0a(:input end:)%0a(:divend:)%0a(:include $[{$SiteGroup}/EditQuickReference]:)%0a(:if e_preview:)%0a!! $[Preview {*$FullName}]%0a'''$[Page is unsaved]'''%0a(:e_preview:)%0a----%0a'''$[End of preview -- remember to save]'''\\%0a[[#top | $[Top] ]]%0a(:ifend:)%0a -time=1316300652 +text=(:Summary:contains the edit page layout form:)%0a!! $[Editing {*$FullName}] %25block class=wikiaction%25%0a(:messages:)%0a(:div id='wikiedit':)%0a(:input e_form:)[[#top]](:e_guibuttons:)\\%0a(:input e_textarea:)\\%0a$[Summary]: (:input e_changesummary:)\\%0a$[Author]: (:input e_author:) (:input e_minorcheckbox:)\\%0a(:input e_savebutton:) (:input e_savedraftbutton:) (:input e_saveeditbutton:) (:input e_previewbutton:) (:input e_cancelbutton:)%0a(:input end:)%0a(:divend:)%0a(:include $[{$SiteGroup}/EditQuickReference]:)%0a(:if e_preview:)%0a!! $[Preview {*$FullName}]%0a'''$[Page is unsaved]'''%0a(:e_preview:)%0a----%0a'''$[End of preview -- remember to save]'''\\%0a[[#top | $[Top] ]]%0a(:ifend:)%0a +time=1724052869 |