|
From: <var...@us...> - 2021-02-23 08:37:22
|
Revision: 10269
http://sourceforge.net/p/phpwiki/code/10269
Author: vargenau
Date: 2021-02-23 08:37:19 +0000 (Tue, 23 Feb 2021)
Log Message:
-----------
plugin SemanticSearch: better test boolean arguments "case_exact", "noheader" and "noform"
Modified Paths:
--------------
trunk/lib/plugin/SemanticSearch.php
trunk/pgsrc/Help%2FSemanticSearchPlugin
Modified: trunk/lib/plugin/SemanticSearch.php
===================================================================
--- trunk/lib/plugin/SemanticSearch.php 2021-02-23 08:30:59 UTC (rev 10268)
+++ trunk/lib/plugin/SemanticSearch.php 2021-02-23 08:37:19 UTC (rev 10269)
@@ -294,6 +294,31 @@
, "\n"
, fmt("See %s", WikiLink(_("Help").":"._("SemanticRelations")))));
extract($args);
+
+ if (($case_exact == '0') || ($case_exact == 'false')) {
+ $case_exact = false;
+ } elseif (($case_exact == '1') || ($case_exact == 'true')) {
+ $case_exact = true;
+ } else {
+ return $this->error(sprintf(_("Argument '%s' must be a boolean"), "case_exact"));
+ }
+
+ if (($noform == '0') || ($noform == 'false')) {
+ $noform = false;
+ } elseif (($noform == '1') || ($noform == 'true')) {
+ $noform = true;
+ } else {
+ return $this->error(sprintf(_("Argument '%s' must be a boolean"), "noform"));
+ }
+
+ if (($noheader == '0') || ($noheader == 'false')) {
+ $noheader = false;
+ } elseif (($noheader == '1') || ($noheader == 'true')) {
+ $noheader = true;
+ } else {
+ return $this->error(sprintf(_("Argument '%s' must be a boolean"), "noheader"));
+ }
+
// for convenience and harmony we allow GET requests also.
if (!$request->isPost()) {
if ($relation or $attribute) // check for good GET request
Modified: trunk/pgsrc/Help%2FSemanticSearchPlugin
===================================================================
--- trunk/pgsrc/Help%2FSemanticSearchPlugin 2021-02-23 08:30:59 UTC (rev 10268)
+++ trunk/pgsrc/Help%2FSemanticSearchPlugin 2021-02-23 08:37:19 UTC (rev 10269)
@@ -1,4 +1,4 @@
-Date: Mon, 22 Feb 2021 19:16:32 +0000
+Date: Tue, 23 Feb 2021 09:33:05 +0000
Mime-Version: 1.0 (Produced by PhpWiki 1.6.0)
Content-Type: application/x-phpwiki;
pagename=Help%2FSemanticSearchPlugin;
@@ -67,7 +67,7 @@
|
|-
| **case_exact**
-|
+| Boolean. If true, search with case exact.
| true
|-
| **regex**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|