]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Strings.php
Model/Photo: use self select functions, reuse backend, fix quotes, add delete()
[friendica.git] / src / Util / Strings.php
index 473774b71dba283c7cbecf28e9a99d8f2a25cd5d..a11ac2fd5831582c302f15cb42a41d5a031e7fe9 100644 (file)
@@ -312,4 +312,20 @@ class Strings
     {
         return (strcasecmp(self::normaliseLink($a), self::normaliseLink($b)) === 0);
     }
+
+
+       /**
+        * Ensures the provided URI has its query string punctuation in order.
+        *
+        * @param string $uri
+        * @return string
+        */
+       public static function ensureQueryParameter($uri)
+       {
+               if (strpos($uri, '?') === false && ($pos = strpos($uri, '&')) !== false) {
+                       $uri = substr($uri, 0, $pos) . '?' . substr($uri, $pos + 1);
+               }
+
+               return $uri;
+       }
 }