Browse Source

added qualifyLength function to test against user inputted strings

CauseFX 3 years ago
parent
commit
dbcc0ef34f
1 changed files with 12 additions and 0 deletions
  1. 12 0
      api/classes/organizr.class.php

+ 12 - 0
api/classes/organizr.class.php

@@ -1908,6 +1908,18 @@ class Organizr
 		}
 	}
 
+	public function qualifyLength($string, $length = 100, $api = false)
+	{
+		if (strlen($string) <= $length) {
+			return true;
+		} else {
+			if ($api) {
+				$this->setResponse(409, 'String is over limit of: ' . $length);
+			}
+			return false;
+		}
+	}
+
 	public function getImages()
 	{
 		$allIconsPrep = array();