1134 | | /** |
1135 | | * bp_is_serialized() |
1136 | | * |
1137 | | * Checks to see if the data passed has been serialized. |
1138 | | * |
1139 | | * @package BuddyPress Core |
1140 | | * @param $data str The data that will be checked |
1141 | | * @return bool false if the data is not serialized |
1142 | | * @return bool true if the data is serialized |
1143 | | */ |
1144 | | function bp_is_serialized( $data ) { |
1145 | | if ( '' == trim($data) ) |
1146 | | return false; |
1147 | | |
1148 | | if ( preg_match( "/^(i|s|a|o|d)(.*);/si", $data ) ) |
1149 | | return true; |
1150 | | |
1151 | | return false; |
1152 | | } |
1153 | | |