Ejemplo n.º 1
0
 public static function recursiveStripTags($INPUT, $ALLOWED_TAGS = '')
 {
     //print "Running recursiveStripTags on "; dumper($INPUT); print "<br>\n"; john_flush();
     if (self::is_assoc($INPUT)) {
         // If this is an associative array, parse it as key => value.
         foreach ($INPUT as $KEY => $VALUE) {
             $INPUT[$KEY] = \Metaclassing\Utility::recursiveStripTags($VALUE, $ALLOWED_TAGS);
         }
     } elseif (is_array($INPUT)) {
         // If this is a normal array, parse it as $value.
         foreach ($INPUT as &$VALUE) {
             $VALUE = \Metaclassing\Utility::recursiveStripTags($VALUE, $ALLOWED_TAGS);
         }
     } elseif (is_string($INPUT)) {
         // If this is a string, run the global strip_tags function.
         $INPUT = @strip_tags($INPUT, $ALLOWED_TAGS);
     }
     // If we dont know wtf we are given, dont muck it up.
     return $INPUT;
 }