code-embed
code-embed copied to clipboard
Page load hungs when using URL embeding
I'm using version 2.3.4 of the plugin and the page I'm trying to load hangs when using URL embedding codes.
Just loading an external page with:
{{https://www.example.com/page}}
But it does not work. I've tried to change these tags to check if there is some kind of conflict with the theme used but no way.
The theme I'm using right now is The 7
Thank you very much
I've found what's wrong about this issue:
First of all, there is an infinite loop in the ce_quick_replace when the requested url gives an error. When there is an error inside the ce_get_file function, the following line always gives the same startpos, because there is no offset and there hasn't been any replacement on $content.
$start_pos = strpos( $content, $options['opening_ident'] . $search, 0 );
This happens because there is an error reading the url to request, in this line:
$url = substr( $content, $start_pos + 1, $end_pos - $start_pos - 1 );
The line should be as follows:
$url = substr( $content, $start_pos + strlen($options['opening_ident']), $end_pos - ($start_pos + strlen($options['opening_ident'])) );
With those changes the problem is fixed.
Will try to make a PR in case anyone is interested
Thanks @galmos - I'll get the change implemented.
Fixed in 2.5