Custom Blacklist Contact Form 7

Coding

Easily set up a blacklist for those marketing lists that somehow get around Akismet. Throw the below in your functions.php file and customize the $blacklist array to filter by email address to your liking.


function contactFilterBlacklist( $result, $tag ) {

    $valid = true;
    $tag = new WPCF7_Shortcode( $tag );
    $blacklist = array(
        'filterme'
    );

    $yourEmail = isset( $_POST['your-email'] ) ? trim( $_POST['your-email'] ) : false;
    if ( !$yourEmail ) return $result;

    foreach ( $blacklist as $keyword ) {
        if ( strpos($yourEmail, $keyword) !== false ) $valid = false;
    }

    if ( !$valid ) $result->invalidate( $tag, "Uh oh. Something's wrong here..." );

    return $result;
}

add_filter( 'wpcf7_validate_email*', 'contactFilterBlacklist', 20, 2 );

Head over to this Contact Form 7 post or their documentation to learn more.

dpkg-scanpackages Stripping Name Field

Cydia, Theming

dpkg-scanpackages isn’t designed to take in some of the user defined fields Cydia repos use. Saurik points out in his How to Host a Cydia Package post how to easily fix this.

This is rather easy: simply add “Name”, “Author”, “Homepage”, and “Icon” to the end of the array “fieldpri”.

Not sure which one the mac specifically uses, but you can find the script files for dpkg-scanpackages in these locations (assuming they might be in the same spot :) ):

./sw/bin/dpkg-scanpackages

./opt/local/bin/dpkg-scanpackages

Otherwise do a little search from the root directory with:

sudo find . -name “*scanpackages*”