From: <var...@us...> - 2021-02-23 08:31:02
|
Revision: 10268 http://sourceforge.net/p/phpwiki/code/10268 Author: vargenau Date: 2021-02-23 08:30:59 +0000 (Tue, 23 Feb 2021) Log Message: ----------- plugin SemanticSearchAdvanced: better test boolean arguments "case_exact", "noheader" and "noform" Modified Paths: -------------- trunk/lib/plugin/SemanticSearchAdvanced.php trunk/pgsrc/Help%2FSemanticSearchAdvancedPlugin Modified: trunk/lib/plugin/SemanticSearchAdvanced.php =================================================================== --- trunk/lib/plugin/SemanticSearchAdvanced.php 2021-02-23 08:19:43 UTC (rev 10267) +++ trunk/lib/plugin/SemanticSearchAdvanced.php 2021-02-23 08:30:59 UTC (rev 10268) @@ -148,7 +148,33 @@ if (isset($this->_norelations_warning)) $form->pushContent(HTML::div(array('class' => 'warning'), _("Warning:") . $this->_norelations_warning)); + 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, peace and harmony we allow GET requests also. if (!$args['s']) // check for good GET request return $form; // nobody called us, so just display our form Modified: trunk/pgsrc/Help%2FSemanticSearchAdvancedPlugin =================================================================== --- trunk/pgsrc/Help%2FSemanticSearchAdvancedPlugin 2021-02-23 08:19:43 UTC (rev 10267) +++ trunk/pgsrc/Help%2FSemanticSearchAdvancedPlugin 2021-02-23 08:30:59 UTC (rev 10268) @@ -33,7 +33,7 @@ | ~* (all) |- | **case_exact** -| +| Boolean. If true, search with case exact. | false |- | **regex** @@ -41,7 +41,7 @@ | auto |- | **noform** -| don't show form with results. +| Boolean. If true, don't show form with results. | false |- | **noheader** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |