wp_iso_descrambler

The timeline below displays how wordpress function wp_iso_descrambler has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.2

/**
 * Converts to ASCII from email subjects.
 *
 * @since 1.2.0
 *
 * @param string $subject Subject line.
 * @return string Converted string to ASCII.
 */
function wp_iso_descrambler($subject)
{
    /* this may only work with iso-8859-1, I'm afraid */
    if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $subject, $matches)) {
        return $subject;
    }
    $subject = str_replace('_', ' ', $matches[2]);
    return preg_replace_callback('#\=([0-9a-f]{2})#i', '_wp_iso_convert', $subject);
}

WordPress Version: 6.1

/**
 * Converts to ASCII from email subjects.
 *
 * @since 1.2.0
 *
 * @param string $string Subject line.
 * @return string Converted string to ASCII.
 */
function wp_iso_descrambler($string)
{
    /* this may only work with iso-8859-1, I'm afraid */
    if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $string, $matches)) {
        return $string;
    } else {
        $subject = str_replace('_', ' ', $matches[2]);
        return preg_replace_callback('#\=([0-9a-f]{2})#i', '_wp_iso_convert', $subject);
    }
}

WordPress Version: 4.3

/**
 * Convert to ASCII from email subjects.
 *
 * @since 1.2.0
 *
 * @param string $string Subject line
 * @return string Converted string to ASCII
 */
function wp_iso_descrambler($string)
{
    /* this may only work with iso-8859-1, I'm afraid */
    if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $string, $matches)) {
        return $string;
    } else {
        $subject = str_replace('_', ' ', $matches[2]);
        return preg_replace_callback('#\=([0-9a-f]{2})#i', '_wp_iso_convert', $subject);
    }
}

WordPress Version: 3.7

/**
 * Convert to ASCII from email subjects.
 *
 * @since 1.2.0
 *
 * @param string $string Subject line
 * @return string Converted string to ASCII
 */
function wp_iso_descrambler($string)
{
    /* this may only work with iso-8859-1, I'm afraid */
    if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $string, $matches)) {
        return $string;
    } else {
        $subject = str_replace('_', ' ', $matches[2]);
        $subject = preg_replace_callback('#\=([0-9a-f]{2})#i', '_wp_iso_convert', $subject);
        return $subject;
    }
}