|
From: <var...@us...> - 2021-02-23 13:53:18
|
Revision: 10271
http://sourceforge.net/p/phpwiki/code/10271
Author: vargenau
Date: 2021-02-23 13:53:17 +0000 (Tue, 23 Feb 2021)
Log Message:
-----------
plugin TitleSearch: better test boolean arguments "case_exact", "noheader" and "auto_redirect"
Modified Paths:
--------------
trunk/lib/plugin/TitleSearch.php
Modified: trunk/lib/plugin/TitleSearch.php
===================================================================
--- trunk/lib/plugin/TitleSearch.php 2021-02-23 13:46:52 UTC (rev 10270)
+++ trunk/lib/plugin/TitleSearch.php 2021-02-23 13:53:17 UTC (rev 10271)
@@ -81,6 +81,33 @@
{
$args = $this->getArgs($argstr, $request);
+ $auto_redirect = $args['auto_redirect'];
+ if (($auto_redirect == '0') || ($auto_redirect == 'false')) {
+ $auto_redirect = false;
+ } elseif (($auto_redirect == '1') || ($auto_redirect == 'true')) {
+ $auto_redirect = true;
+ } else {
+ return $this->error(sprintf(_("Argument '%s' must be a boolean"), "auto_redirect"));
+ }
+
+ $noheader = $args['noheader'];
+ 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"));
+ }
+
+ $case_exact = $args['case_exact'];
+ 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 (isset($args['limit']) && !is_limit($args['limit'])) {
return HTML::p(array('class' => "error"),
_("Illegal “limit” argument: must be an integer or two integers separated by comma"));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|