Email a copy of 'Code Injection Follow Up' to a friend
Loading ...
(88 votes, average: 3.90 out of 5)
5 thoughts on “Code Injection Follow Up”
/**
* 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.
/**
* 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.
So how does the exploit work?