diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/blocklist.php | 4 | ||||
-rw-r--r-- | scripts/forms.php | 18 | ||||
-rw-r--r-- | scripts/pmform.php | 2 | ||||
-rw-r--r-- | scripts/stdconfig.php | 40 | ||||
-rw-r--r-- | scripts/stdmarkup.php | 8 | ||||
-rw-r--r-- | scripts/utils.php | 2 | ||||
-rw-r--r-- | scripts/version.php | 2 | ||||
-rw-r--r-- | scripts/xlpage-utf-8.php | 4 |
8 files changed, 71 insertions, 9 deletions
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;} |