Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. $stylesheets = $xpath->query('//*/link');
  2. for($i=0; $i<$stylesheets->length; $i++){
  3. $href = $stylesheets->item($i);
  4. $attr = $href->getAttribute('href');
  5. $href->removeAttribute('href');
  6. $href->setAttribute('href', $app->getCookie('site_path')."/".$attr);
  7. }
  8. $images = $xpath->query('//*/img');
  9. for($i=0; $i<$images->length; $i++){
  10. $src = $images->item($i);
  11. $attr = $src->getAttribute('src');
  12. $src->removeAttribute('src');
  13. $src->setAttribute('src', $app->getCookie('site_path')."/".$attr);
  14. }
  15. $srcipts = $xpath->query('//*/script');
  16. for($i=0; $i<$srcipts->length; $i++){
  17. $src = $srcipts->item($i);
  18. $attr = $src->getAttribute('src');
  19. $src->removeAttribute('src');
  20. $src->setAttribute('src', $app->getCookie('site_path')."/".$attr);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement