Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $stylesheets = $xpath->query('//*/link');
- for($i=0; $i<$stylesheets->length; $i++){
- $href = $stylesheets->item($i);
- $attr = $href->getAttribute('href');
- $href->removeAttribute('href');
- $href->setAttribute('href', $app->getCookie('site_path')."/".$attr);
- }
- $images = $xpath->query('//*/img');
- for($i=0; $i<$images->length; $i++){
- $src = $images->item($i);
- $attr = $src->getAttribute('src');
- $src->removeAttribute('src');
- $src->setAttribute('src', $app->getCookie('site_path')."/".$attr);
- }
- $srcipts = $xpath->query('//*/script');
- for($i=0; $i<$srcipts->length; $i++){
- $src = $srcipts->item($i);
- $attr = $src->getAttribute('src');
- $src->removeAttribute('src');
- $src->setAttribute('src', $app->getCookie('site_path')."/".$attr);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement