Skip to content

Commit

Permalink
hardening
Browse files Browse the repository at this point in the history
  • Loading branch information
padams committed Jan 25, 2022
1 parent 9a8b3de commit badb81d
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions owa_httpRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,26 +112,29 @@ function extractAnchorText( $url ) {

$anchortext = '';

foreach( $anchors as $match ) {
if ( $anchors ) {

// match[0] = full matching <a> tag
// $match[2] = link address
// $match[3] = link text

//strip any HTML tags (i.e. img, span, etc)
if ( $match[3] ) {
foreach( $anchors as $match ) {

// match[0] = full matching <a> tag
// $match[2] = link address
// $match[3] = link text

$match[3] = trim( owa_sanitize::stripAllTags( $match[3] ) );
}

// if anything is left as anchortext then use that
if ( $match[3] && $url === $match[2] ) {

$anchortext = $match[3];

owa_coreAPI::debug('Anchor info: '.print_r($this->anchor_info, true));

return owa_lib::inputFilter( $anchotext );
//strip any HTML tags (i.e. img, span, etc)
if ( $match[3] ) {

$match[3] = trim( owa_sanitize::stripAllTags( $match[3] ) );
}

// if anything is left as anchortext then use that
if ( $match[3] && $url === $match[2] ) {

$anchortext = $match[3];

owa_coreAPI::debug('Anchor info: '.print_r($this->anchor_info, true));

return owa_lib::inputFilter( $anchotext );
}
}
}
}
Expand Down

0 comments on commit badb81d

Please sign in to comment.