apache_mod_loaded

Definition:
function apache_mod_loaded($mod, $default = false) {}

Does the specified module exist in the Apache config?

Parameters

  • string $mod: e.g. mod_rewrite
  • bool $default: The default return value if the module is not found

Source code

function apache_mod_loaded($mod, $default = false) {

	global $is_apache;



	if ( !$is_apache )

		return false;



	if ( function_exists('apache_get_modules') ) {

		$mods = apache_get_modules();

		if ( in_array($mod, $mods) )

			return true;

	} elseif ( function_exists('phpinfo') ) {

			ob_start();

			phpinfo(8);

			$phpinfo = ob_get_clean();

			if ( false !== strpos($phpinfo, $mod) )

				return true;

	}

	return $default;

}

533

antispambot

Definition:
function antispambot($emailaddy, $mailto=0) {}

Converts email addresses characters to HTML entities to block spam bots.

Parameters

  • string $emailaddy: Email address.
  • int $mailto: Optional. Range from 0 to 1. Used for encoding.

Return values

returns:Converted email address.

Source code

function antispambot($emailaddy, $mailto=0) {

	$emailNOSPAMaddy = '';

	srand ((float) microtime() * 1000000);

	for ($i = 0; $i < strlen($emailaddy); $i = $i + 1) {

		$j = floor(rand(0, 1+$mailto));

		if ($j==0) {

			$emailNOSPAMaddy .= '&#'.ord(substr($emailaddy,$i,1)).';';

		} elseif ($j==1) {

			$emailNOSPAMaddy .= substr($emailaddy,$i,1);

		} elseif ($j==2) {

			$emailNOSPAMaddy .= '%'.zeroise(dechex(ord(substr($emailaddy, $i, 1))), 2);

		}

	}

	$emailNOSPAMaddy = str_replace('@','@',$emailNOSPAMaddy);

	return $emailNOSPAMaddy;

}

531

allow_subdomain_install

Definition:
function allow_subdomain_install() {}

Allow subdomain install

Return values

returns:Whether subdomain install is allowed

Source code

function allow_subdomain_install() {

	$domain = preg_replace( '|https?://([^/]+)|', '$1', get_option( 'siteurl' ) );

	if( false !== strpos( $domain, '/' ) || 'localhost' == $domain || preg_match( '|[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|', $domain ) )

		return false;



	return true;

}

529

allow_subdirectory_install

Definition:
function allow_subdirectory_install() {}

Allow subdirectory install

Return values

returns:Whether subdirectory install is allowed

Defined filters

  • allow_subdirectory_install
    apply_filters( 'allow_subdirectory_install', false )

Source code

function allow_subdirectory_install() {

	global $wpdb;

	if ( apply_filters( 'allow_subdirectory_install', false ) )

		return true;



	if ( defined( 'ALLOW_SUBDIRECTORY_INSTALL' ) && ALLOW_SUBDIRECTORY_INSTALL )

		return true;



	$post = $wpdb->get_row( "SELECT ID FROM $wpdb->posts WHERE post_date < DATE_SUB(NOW(), INTERVAL 1 MONTH) AND post_status = 'publish'" );

	if ( empty( $post ) )

		return true;



	return false;

}

527

allowed_tags

Display all of the allowed tags in HTML format with attributes.
This is useful for displaying in the comment area, which elements and attributes are supported. As well as any plugins which want to display it.

Return values

returns:HTML allowed tags entity encoded.

Source code

function allowed_tags() {

	global $allowedtags;

	$allowed = '';

	foreach ( (array) $allowedtags as $tag => $attributes ) {

		$allowed .= '<'.$tag;

		if ( 0 < count($attributes) ) {

			foreach ( $attributes as $attribute => $limits ) {

				$allowed .= ' '.$attribute.'=""';

			}

		}

		$allowed .= '> ';

	}

	return htmlentities($allowed);

}

525