Skip to:
Content
Pages
Categories
Search
Top
Bottom

Refined tag stripping function

  • Avatar of eliasbr
    eliasbr
    Member

    @eliasbr

    Since I wanted to allow my users to write links and other tags in their profile fields, I exchanged the strip_tags function calls with calls to this function:

    `
    function strip_search_links($str) {
    $pattern=’(.+?)‘;
    $pattern = addslashes($pattern);
    $pattern = str_replace(‘/’, ‘\/’, $pattern);
    $pattern = str_replace(‘?s’, ‘\?s’, $pattern);
    $pattern = “/”.$pattern.”/”;
    $str=preg_replace($pattern, ‘${2}’, $str);
    return $str;
    }
    `

    It removes only the member search links inserted by bp.

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.