kikookik Posted September 26, 2013 Share Posted September 26, 2013 Hello; I want to remove any instance of such : <link rel="stylesheet" href="ANYTHING HERE.css" type="text/css"> Link to comment https://forums.phpfreaks.com/topic/282463-remove-all-link-stylesheets-from-document-regex-or-dom/ Share on other sites More sharing options...
.josh Posted September 27, 2013 Share Posted September 27, 2013 Sounds like you have a battle plan. Link to comment https://forums.phpfreaks.com/topic/282463-remove-all-link-stylesheets-from-document-regex-or-dom/#findComment-1451336 Share on other sites More sharing options...
Irate Posted September 27, 2013 Share Posted September 27, 2013 To make sure, you are going to run this on your own server and do not plan to do XSS, right? Yeah, you better. Check JavaScript to write some code for that, otherwise just don't include them in your document. Link to comment https://forums.phpfreaks.com/topic/282463-remove-all-link-stylesheets-from-document-regex-or-dom/#findComment-1451459 Share on other sites More sharing options...
ignace Posted September 27, 2013 Share Posted September 27, 2013 This snippet should remove any and all <link/> tags. echo preg_replace('!<link([^>]+)/?>!', '', file_get_contents('http://domain.top/file.ext')); Link to comment https://forums.phpfreaks.com/topic/282463-remove-all-link-stylesheets-from-document-regex-or-dom/#findComment-1451464 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.