Beispiel #1
0
function html_cleanup($s, $tags = false)
{
    if (is_string($s) == true) {
        if ($tags != false) {
            $s = strip_tags_content($s, $tags, $invert = false);
        }
        return htmlspecialchars($s, ENT_QUOTES, 'UTF-8');
    } elseif (is_array($s) == true) {
        foreach ($s as $k => $v) {
            if (is_string($v) == true) {
                if ($tags != false) {
                    $v = strip_tags_content($v, $tags, $invert = false);
                }
                $s[$k] = htmlspecialchars($v, ENT_QUOTES, 'UTF-8');
            } elseif (is_array($v) == true) {
                $s[$k] = html_cleanup($v, $tags);
            }
        }
    }
    return $s;
}
Beispiel #2
0
<?php 
        } else {
            ?>
                <li class="twitter">
                    <img src="images/news/twitter_box.png" alt="Twitter">
                    <article class="twitter_copy">
                        <a href="<?php 
            echo $post->post_content;
            ?>
">
<?php 
            preg_match('!http://twitter.com/([^/]+)/status/(\\d+)!', $post->post_content, $matches);
            $author = $matches[1];
            $tweetid = $matches[2];
            $string = strip_tags(wp_oembed_get($post->post_content, $args), '<p><a>');
            $bare = strip_tags_content($string);
            $tweet = str_replace($bare, '', $string);
            $dom = new DomDocument();
            $dom->loadHTML($tweet);
            $last = '';
            foreach ($dom->getElementsByTagName('a') as $node) {
                $last = $node->nodeValue;
            }
            ?>
                               
                            <header>                                           
                                <p>@<?php 
            echo $author;
            ?>
</p>
                            </header>                     
 private function eDetail()
 {
     if (is_post()) {
         $this->loadHelper('Validator');
         $data = ['firstname' => validate('required', 'firstname'), 'lastname' => validate('required', 'lastname'), 'nickname' => validate('required', 'nickname')];
         if (validator($data)) {
             $data['phone'] = $_POST['phone'];
             $data['facebook'] = $_POST['facebook'];
             $data['line'] = $_POST['line'];
             $data['signature'] = strip_tags_content($_POST['signature'], '<script><object>', true);
             $user = new User();
             $user->setDetail(auth('id'), $data);
             $_SESSION['user'] = $user->getDetail(auth('id'));
             cache_forgot('user.i.' . auth('id'));
         }
     }
 }