* Added valid_base64() to the Validation class
* Tightened up validation of the supplied string given to the decode() method of the Encryption class (#3320)
diff --git a/system/libraries/Validation.php b/system/libraries/Validation.php
index 162d362..7720a7d 100644
--- a/system/libraries/Validation.php
+++ b/system/libraries/Validation.php
@@ -573,6 +573,23 @@
// --------------------------------------------------------------------
/**
+ * Valid Base64
+ *
+ * Tests a string for characters outside of the Base64 alphabet
+ * as defined by RFC 2045 http://www.faqs.org/rfcs/rfc2045
+ *
+ * @access public
+ * @param string
+ * @return bool
+ */
+ function valid_base64($str)
+ {
+ return (bool) ! preg_match('/[^a-zA-Z0-9\/\+=]/', $str);
+ }
+
+ // --------------------------------------------------------------------
+
+ /**
* Set Select
*
* Enables pull-down lists to be set to the value the user