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 00ccf224f3d235af80341c48a5bf2f66552656da..7a43629c0abf8dc23034e7b64f7bee5dab8d63d4 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]