Added isBase64Encoded() with a simple check on Base64-encoded messages.
authorRoland Häder <roland@mxchange.org>
Mon, 18 Apr 2011 16:53:56 +0000 (16:53 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 18 Apr 2011 16:53:56 +0000 (16:53 +0000)
inc/classes/main/class_BaseFrameworkSystem.php

index 00ccf22..7a43629 100644 (file)
@@ -1807,6 +1807,20 @@ class BaseFrameworkSystem extends stdClass implements FrameworkInterface {
                // Return it
                return $strFinal;
        }
+
+       /**
+        * Checks wether the given encoded data was encoded with Base64
+        *
+        * @param       $encodedData    Encoded data we shall check
+        * @return      $isBase64               Wether the encoded data is Base64
+        */
+       protected function isBase64Encoded ($encodedData) {
+               // Determine it
+               $isBase64 = (@base64_decode($encodedData, true) !== false);
+
+               // Return it
+               return $isBase64;
+       }
 }
 
 // [EOF]