示例#1
0
 function passwordReset($login, $email)
 {
     $username = decodeText($login);
     $eemail = decodeText($email);
     $this->commitResetPassword($username, $eemail);
 }
示例#2
0
/**
 * Normalize tag to avoid duplicate noise.
 *
 * Currently we trim spaces, lowercase, remove quotes and HTML entities, and
 * treat 'star wars', 'star-wars', 'star+wars' and 'star_wars' as similar
 * (with the underscore version as the base case).
 *
 * @todo Since tag is used as filename not all characters should be allowed.
 *
 * @param string $tag
 * @return string
 */
function normalizeTag($tag)
{
    $tag = trim(strip_tags($tag));
    $tag = decodeText($tag, 'special');
    // Decode the rest of the HTML enities if possible.
    $tag = unentify($tag);
    $tag = trim(px_strtolower($tag));
    $tag = str_replace(array("'", '"'), "", $tag);
    $tag = str_replace(array(" ", "-", "+"), "_", $tag);
    // Replacing character(s) not allowed in filenames.
    $tag = str_replace("/", "_", $tag);
    // Remove HTML enities we didn't manage to decode.
    $tag = preg_replace("/&([a-z\\d]{2,7}|#\\d{2,5});/i", "", $tag);
    if (empty($tag)) {
        $tag = "__empty__";
    }
    return $tag;
}