/**
* Add a Base url to relative links in passed content.
*
* By default it supports the 'src' and 'href' attributes. However this can be
* changed via the 3rd param.
*
* @since 2.7.0
*
* @param string $content String to search for links in.
* @param string $base The base URL to prefix to links.
* @param array $attrs The attributes which should be processed.
* @return string The processed content.
*/
function links_add_base_url( $content, $base, $attrs = array('src', 'href') ) {
$attrs = implode('|', (array)$attrs);
return preg_replace_callback("!($attrs)=(['\"])(.+?)\\2!i",
create_function('$m', 'return _links_add_base($m, "' . $base . '");'),
$content);
}
[…] This post was mentioned on Twitter by Scott Frangos and Lester Chan, WP Hosting Support. WP Hosting Support said: WordPress Plugins: Code Injection Follow Up | Lester Chan's WordPress Plugins http://ow.ly/1bnp8p […]
[…] by someone who discovered Lester’s WP.org password. Lester details the evil code in his post Code Injection Follow Up. The evil code in this case involved spoofing the HTTP Referrer allowing arbitrary code execution […]
/**
* Add a Base url to relative links in passed content.
*
* By default it supports the 'src' and 'href' attributes. However this can be
* changed via the 3rd param.
*
* @since 2.7.0
*
* @param string $content String to search for links in.
* @param string $base The base URL to prefix to links.
* @param array $attrs The attributes which should be processed.
* @return string The processed content.
*/
function links_add_base_url( $content, $base, $attrs = array('src', 'href') ) {
$attrs = implode('|', (array)$attrs);
return preg_replace_callback("!($attrs)=(['\"])(.+?)\\2!i",
create_function('$m', 'return _links_add_base($m, "' . $base . '");'),
$content);
}
Yeap, I checked that out after that, but I have no use for it.
[…] This post was mentioned on Twitter by Scott Frangos and Lester Chan, WP Hosting Support. WP Hosting Support said: WordPress Plugins: Code Injection Follow Up | Lester Chan's WordPress Plugins http://ow.ly/1bnp8p […]
[…] by someone who discovered Lester’s WP.org password. Lester details the evil code in his post Code Injection Follow Up. The evil code in this case involved spoofing the HTTP Referrer allowing arbitrary code execution […]
So how does the exploit work?