Mpdf \ MpdfException (E_ERROR)
The HTML code size is larger than pcre.backtrack_limit 1000000. You should use WriteHTML() with smaller string lengths. Mpdf\MpdfException thrown with message "The HTML code size is larger than pcre.backtrack_limit 1000000. You should use WriteHTML() with smaller string lengths." Stacktrace: #9 Mpdf\MpdfException in /home/www-data/goldswitzerland.com/wp-content/uploads/vendor/mpdf/mpdf/src/Mpdf.php:26895 #8 Mpdf\Mpdf:AdjustHTML in /home/www-data/goldswitzerland.com/wp-content/uploads/vendor/mpdf/mpdf/src/Mpdf.php:13281 #7 Mpdf\Mpdf:WriteHTML in /home/www-data/goldswitzerland.com/wp-content/plugins/pdf-print/pdf-print.php:1324 #6 pdfprnt_print in /home/www-data/goldswitzerland.com/wp-includes/class-wp-hook.php:307 #5 WP_Hook:apply_filters in /home/www-data/goldswitzerland.com/wp-includes/class-wp-hook.php:331 #4 WP_Hook:do_action in /home/www-data/goldswitzerland.com/wp-includes/plugin.php:524 #3 do_action_ref_array in /home/www-data/goldswitzerland.com/wp-includes/class-wp.php:787 #2 WP:main in /home/www-data/goldswitzerland.com/wp-includes/functions.php:1330 #1 wp in /home/www-data/goldswitzerland.com/wp-blog-header.php:16 #0 require in /home/www-data/goldswitzerland.com/index.php:17
Stack frames (10)
9
Mpdf\MpdfException
/home/www-data/goldswitzerland.com/wp-content/uploads/vendor/mpdf/mpdf/src/Mpdf.php26895
8
Mpdf\Mpdf AdjustHTML
/home/www-data/goldswitzerland.com/wp-content/uploads/vendor/mpdf/mpdf/src/Mpdf.php13281
7
Mpdf\Mpdf WriteHTML
/home/www-data/goldswitzerland.com/wp-content/plugins/pdf-print/pdf-print.php1324
6
pdfprnt_print
/home/www-data/goldswitzerland.com/wp-includes/class-wp-hook.php307
5
WP_Hook apply_filters
/home/www-data/goldswitzerland.com/wp-includes/class-wp-hook.php331
4
WP_Hook do_action
/home/www-data/goldswitzerland.com/wp-includes/plugin.php524
3
do_action_ref_array
/home/www-data/goldswitzerland.com/wp-includes/class-wp.php787
2
WP main
/home/www-data/goldswitzerland.com/wp-includes/functions.php1330
1
wp
/home/www-data/goldswitzerland.com/wp-blog-header.php16
0
require
/home/www-data/goldswitzerland.com/index.php17
/home/www-data/goldswitzerland.com/wp-content/uploads/vendor/mpdf/mpdf/src/Mpdf.php
    }
 
    function lesser_entity_decode($html)
    {
        // supports the most used entity codes (only does ascii safe characters)
        $html = str_replace("&lt;", "<", $html);
        $html = str_replace("&gt;", ">", $html);
 
        $html = str_replace("&apos;", "'", $html);
        $html = str_replace("&quot;", '"', $html);
        $html = str_replace("&amp;", "&", $html);
 
        return $html;
    }
 
    function AdjustHTML($html, $tabSpaces = 8)
    {
        $limit = ini_get('pcre.backtrack_limit');
        if (strlen($html) > $limit) {
            throw new \Mpdf\MpdfException(sprintf(
                'The HTML code size is larger than pcre.backtrack_limit %d. You should use WriteHTML() with smaller string lengths.',
                $limit
            ));
        }
 
        preg_match_all("/(<annotation.*?>)/si", $html, $m);
        if (count($m[1])) {
            for ($i = 0; $i < count($m[1]); $i++) {
                $sub = preg_replace("/\n/si", "\xbb\xa4\xac", $m[1][$i]);
                $html = preg_replace('/' . preg_quote($m[1][$i], '/') . '/si', $sub, $html);
            }
        }
 
        preg_match_all("/(<svg.*?<\/svg>)/si", $html, $svgi);
        if (count($svgi[0])) {
            for ($i = 0; $i < count($svgi[0]); $i++) {
                $file = $this->cache->write('/_tempSVG' . uniqid(random_int(1, 100000), true) . '_' . $i . '.svg', $svgi[0][$i]);
                $html = str_replace($svgi[0][$i], '<img src="' . $file . '" />', $html);
            }
        }
Arguments
  1. "The HTML code size is larger than pcre.backtrack_limit 1000000. You should use WriteHTML() with smaller string lengths."
    
/home/www-data/goldswitzerland.com/wp-content/uploads/vendor/mpdf/mpdf/src/Mpdf.php
            // Close any open block tags
            $arr = [];
            $ai = 0;
            for ($b = $this->blklvl; $b > 0; $b--) {
                $this->tag->CloseTag($this->blk[$b]['tag'], $arr, $ai);
            }
            // Output any text left in buffer
            if (count($this->textbuffer)) {
                $this->printbuffer($this->textbuffer);
            }
            $this->bufferoutput = true;
            $this->textbuffer = [];
            $this->headerbuffer = '';
            $properties = $this->cssManager->MergeCSS('BLOCK', 'BODY', '');
            $this->setCSS($properties, '', 'BODY');
        }
 
        mb_internal_encoding('UTF-8');
 
        $html = $this->AdjustHTML($html, $this->tabSpaces); // Try to make HTML look more like XHTML
 
        if ($this->autoScriptToLang) {
            $html = $this->markScriptToLang($html);
        }
 
        preg_match_all('/<htmlpageheader([^>]*)>(.*?)<\/htmlpageheader>/si', $html, $h);
        for ($i = 0; $i < count($h[1]); $i++) {
            if (preg_match('/name=[\'|\"](.*?)[\'|\"]/', $h[1][$i], $n)) {
                $this->pageHTMLheaders[$n[1]]['html'] = $h[2][$i];
                $this->pageHTMLheaders[$n[1]]['h'] = $this->_getHtmlHeight($h[2][$i]);
            }
        }
        preg_match_all('/<htmlpagefooter([^>]*)>(.*?)<\/htmlpagefooter>/si', $html, $f);
        for ($i = 0; $i < count($f[1]); $i++) {
            if (preg_match('/name=[\'|\"](.*?)[\'|\"]/', $f[1][$i], $n)) {
                $this->pageHTMLfooters[$n[1]]['html'] = $f[2][$i];
                $this->pageHTMLfooters[$n[1]]['h'] = $this->_getHtmlHeight($f[2][$i]);
            }
        }
 
/home/www-data/goldswitzerland.com/wp-content/plugins/pdf-print/pdf-print.php
                        $pdfprnt_options['pdf_margins']['top'],
                        $pdfprnt_options['pdf_margins']['bottom']
                    );
                }
                $mpdf->allow_charset_conversion = true;
                $mpdf->charset_in               = get_bloginfo( 'charset' );
                if ( 0 !== intval( $pdfprnt_options['additional_fonts'] ) ) {
                    $mpdf->autoScriptToLang = true;
                    $mpdf->autoLangToFont   = true;
                    $mpdf->baseScript       = 1;
                    $mpdf->autoVietnamese   = true;
                    $mpdf->autoArabic       = true;
                }
                if ( is_rtl() ) {
                    $mpdf->SetDirectionality( 'rtl' );
                }
                $mpdf->SetTitle( htmlspecialchars_decode( implode( ',', $titles ) ) );
                $mpdf->SetAuthor( implode( ',', $authors ) );
                $mpdf->SetSubject( get_bloginfo( 'blogdescription' ) );
                $mpdf->WriteHTML( pdfprnt_generate_template( $html ) );
                do_action_ref_array( 'bwsplgns_mpdf', array( &$mpdf ) );
                if ( 'download' === $pdfprnt_options['file_action'] ) {
                    $mpdf->Output( '', 'D' );
                } else {
                    $mpdf->Output();
                }
                die();
                break;
            case 'print':
                $last = count( $posts );
                $i    = 1;
                $html = '<div id="content">';
                foreach ( $posts as $p ) {
                    if ( function_exists( 'et_theme_builder_get_template_layouts' ) && function_exists( 'et_theme_builder_frontend_render_header' ) ) {
                        $layouts = et_theme_builder_get_template_layouts();
                        ob_start();
                        et_theme_builder_frontend_render_header(
                            $layouts[ ET_THEME_BUILDER_HEADER_LAYOUT_POST_TYPE ]['id'],
                            $layouts[ ET_THEME_BUILDER_HEADER_LAYOUT_POST_TYPE ]['enabled'],
                            $layouts[ ET_THEME_BUILDER_TEMPLATE_POST_TYPE ]
/home/www-data/goldswitzerland.com/wp-includes/class-wp-hook.php
 
        $nesting_level = $this->nesting_level++;
 
        $this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
        $num_args                           = count( $args );
 
        do {
            $this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
            $priority                                 = $this->current_priority[ $nesting_level ];
 
            foreach ( $this->callbacks[ $priority ] as $the_ ) {
                if ( ! $this->doing_action ) {
                    $args[0] = $value;
                }
 
                // Avoid the array_slice() if possible.
                if ( 0 == $the_['accepted_args'] ) {
                    $value = call_user_func( $the_['function'] );
                } elseif ( $the_['accepted_args'] >= $num_args ) {
                    $value = call_user_func_array( $the_['function'], $args );
                } else {
                    $value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
                }
            }
        } while ( false !== next( $this->iterations[ $nesting_level ] ) );
 
        unset( $this->iterations[ $nesting_level ] );
        unset( $this->current_priority[ $nesting_level ] );
 
        $this->nesting_level--;
 
        return $value;
    }
 
    /**
     * Calls the callback functions that have been added to an action hook.
     *
     * @since 4.7.0
     *
     * @param array $args Parameters to pass to the callback functions.
/home/www-data/goldswitzerland.com/wp-includes/class-wp-hook.php
        } while ( false !== next( $this->iterations[ $nesting_level ] ) );
 
        unset( $this->iterations[ $nesting_level ] );
        unset( $this->current_priority[ $nesting_level ] );
 
        $this->nesting_level--;
 
        return $value;
    }
 
    /**
     * Calls the callback functions that have been added to an action hook.
     *
     * @since 4.7.0
     *
     * @param array $args Parameters to pass to the callback functions.
     */
    public function do_action( $args ) {
        $this->doing_action = true;
        $this->apply_filters( '', $args );
 
        // If there are recursive calls to the current action, we haven't finished it until we get to the last one.
        if ( ! $this->nesting_level ) {
            $this->doing_action = false;
        }
    }
 
    /**
     * Processes the functions hooked into the 'all' hook.
     *
     * @since 4.7.0
     *
     * @param array $args Arguments to pass to the hook callbacks. Passed by reference.
     */
    public function do_all_hook( &$args ) {
        $nesting_level                      = $this->nesting_level++;
        $this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
 
        do {
            $priority = current( $this->iterations[ $nesting_level ] );
/home/www-data/goldswitzerland.com/wp-includes/plugin.php
    // Do 'all' actions first.
    if ( isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $hook_name;
        $all_args            = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
        _wp_call_all_hook( $all_args );
    }
 
    if ( ! isset( $wp_filter[ $hook_name ] ) ) {
        if ( isset( $wp_filter['all'] ) ) {
            array_pop( $wp_current_filter );
        }
 
        return;
    }
 
    if ( ! isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $hook_name;
    }
 
    $wp_filter[ $hook_name ]->do_action( $args );
 
    array_pop( $wp_current_filter );
}
 
/**
 * Checks if any action has been registered for a hook.
 *
 * When using the `$callback` argument, this function may return a non-boolean value
 * that evaluates to false (e.g. 0), so use the `===` operator for testing the return value.
 *
 * @since 2.5.0
 *
 * @see has_filter() has_action() is an alias of has_filter().
 *
 * @param string                      $hook_name The name of the action hook.
 * @param callable|string|array|false $callback  Optional. The callback to check for.
 *                                               This function can be called unconditionally to speculatively check
 *                                               a callback that may or may not exist. Default false.
 * @return bool|int If `$callback` is omitted, returns boolean for whether the hook has
 *                  anything registered. When checking a specific function, the priority
/home/www-data/goldswitzerland.com/wp-includes/class-wp.php
        $this->init();
 
        $parsed = $this->parse_request( $query_args );
 
        $this->send_headers();
 
        if ( $parsed ) {
            $this->query_posts();
            $this->handle_404();
            $this->register_globals();
        }
 
        /**
         * Fires once the WordPress environment has been set up.
         *
         * @since 2.1.0
         *
         * @param WP $wp Current WordPress environment instance (passed by reference).
         */
        do_action_ref_array( 'wp', array( &$this ) );
    }
}
 
/home/www-data/goldswitzerland.com/wp-includes/functions.php
    }
 
    return wp_remote_retrieve_body( $response );
}
 
/**
 * Set up the WordPress query.
 *
 * @since 2.0.0
 *
 * @global WP       $wp           Current WordPress environment instance.
 * @global WP_Query $wp_query     WordPress Query object.
 * @global WP_Query $wp_the_query Copy of the WordPress Query object.
 *
 * @param string|array $query_vars Default WP_Query arguments.
 */
function wp( $query_vars = '' ) {
    global $wp, $wp_query, $wp_the_query;
 
    $wp->main( $query_vars );
 
    if ( ! isset( $wp_the_query ) ) {
        $wp_the_query = $wp_query;
    }
}
 
/**
 * Retrieve the description for the HTTP status.
 *
 * @since 2.3.0
 * @since 3.9.0 Added status codes 418, 428, 429, 431, and 511.
 * @since 4.5.0 Added status codes 308, 421, and 451.
 * @since 5.1.0 Added status code 103.
 *
 * @global array $wp_header_to_desc
 *
 * @param int $code HTTP status code.
 * @return string Status description if found, an empty string otherwise.
 */
function get_status_header_desc( $code ) {
/home/www-data/goldswitzerland.com/wp-blog-header.php
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
/home/www-data/goldswitzerland.com/index.php
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
 
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );
 
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
 
Arguments
  1. "/home/www-data/goldswitzerland.com/wp-blog-header.php"
    

Environment & details:

Key Value
print
"pdf"
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE
"Apache"
REQUEST_URI
"/fed-to-print-9-5-trillion-and-buy-all-the-gold-in-the-world/?print=pdf"
USER
"www-data"
HOME
"/home/www-data"
SCRIPT_NAME
"/index.php"
QUERY_STRING
"print=pdf"
REQUEST_METHOD
"GET"
SERVER_PROTOCOL
"HTTP/1.1"
GATEWAY_INTERFACE
"CGI/1.1"
REDIRECT_QUERY_STRING
"print=pdf"
REDIRECT_URL
"/fed-to-print-9-5-trillion-and-buy-all-the-gold-in-the-world/"
REMOTE_PORT
"22584"
SCRIPT_FILENAME
"/home/www-data/goldswitzerland.com/index.php"
SERVER_ADMIN
"[email protected]"
CONTEXT_DOCUMENT_ROOT
"/home/www-data/goldswitzerland.com"
CONTEXT_PREFIX
""
REQUEST_SCHEME
"https"
DOCUMENT_ROOT
"/home/www-data/goldswitzerland.com"
REMOTE_ADDR
"3.215.79.204"
SERVER_PORT
"443"
SERVER_ADDR
"217.150.245.148"
SERVER_NAME
"goldswitzerland.com"
SERVER_SIGNATURE
""
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
HTTP_CF_IPCOUNTRY
"US"
HTTP_CF_DEVICE_TYPE
"desktop"
HTTP_CF_CONNECTING_IP
"3.215.79.204"
HTTP_USER_AGENT
"CCBot/2.0 (https://commoncrawl.org/faq/)"
HTTP_ACCEPT
"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_ACCEPT_LANGUAGE
"en-US,en;q=0.5"
HTTP_CDN_LOOP
"cloudflare; subreqs=1"
HTTP_CF_EW_VIA
"15"
HTTP_CF_VISITOR
"{\"scheme\":\"https\"}"
HTTP_X_FORWARDED_PROTO
"https"
HTTP_CF_RAY
"721377b3d4145d74-ZRH"
HTTP_X_FORWARDED_FOR
"3.215.79.204"
HTTP_ACCEPT_ENCODING
"gzip"
HTTP_CONNECTION
"Keep-Alive"
HTTP_HOST
"goldswitzerland.com"
proxy-nokeepalive
"1"
SSL_TLS_SNI
"goldswitzerland.com"
HTTPS
"on"
HTTP_AUTHORIZATION
""
UNIQUE_ID
"YrfriOu6eNILmoQKspo-rAAAAAI"
REDIRECT_STATUS
"200"
REDIRECT_SSL_TLS_SNI
"goldswitzerland.com"
REDIRECT_HTTPS
"on"
REDIRECT_HTTP_AUTHORIZATION
""
REDIRECT_UNIQUE_ID
"YrfriOu6eNILmoQKspo-rAAAAAI"
FCGI_ROLE
"RESPONDER"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1656220552.3635
REQUEST_TIME
1656220552
empty
0. Whoops\Handler\PrettyPageHandler