Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsolete polyfill #106

Open
IanDelMar opened this issue Dec 24, 2024 · 0 comments
Open

Obsolete polyfill #106

IanDelMar opened this issue Dec 24, 2024 · 0 comments

Comments

@IanDelMar
Copy link

IanDelMar commented Dec 24, 2024

The plugin requires PHP 7

if ( ! function_exists( 'str_getcsv' ) ) {
/**
* PHP version less than 5.3 don't have str_getcsv natively.
*
* @param mixed $string
* @return multitype:
*/
function str_getcsv( $string ) {
$logger = new PostmanLogger( 'postman-common-functions' );
if ( $logger->isDebug() ) {
$logger->debug( 'Using custom str_getcsv' );
}
return PostmanUtils::postman_strgetcsv_impl( $string );
}
}

function getmxrr($hostname, &$mxhosts, &$mxweight) {
if (! is_array ( $mxhosts )) {
$mxhosts = array ();
}
$hostname = escapeshellarg ( $hostname );
if (! empty ( $hostname )) {
$output = "";
@exec ( "nslookup.exe -type=MX $hostname.", $output );
$imx = - 1;
foreach ( $output as $line ) {
$imx ++;
$parts = "";
if (preg_match ( "/^$hostname\tMX preference = ([0-9]+), mail exchanger = (.*)$/", $line, $parts )) {
$mxweight [$imx] = $parts [1];
$mxhosts [$imx] = $parts [2];
}
}
return ($imx != - 1);
}
return false;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant