Capitan Cloud преди 2 години
родител
ревизия
041f24771b
променени са 3 файла, в които са добавени 172 реда и са изтрити 16 реда
  1. 14 9
      index.html
  2. 117 0
      post.php
  3. 41 7
      surf.php

+ 14 - 9
index.html

@@ -29,7 +29,7 @@ along with LightOff. If not, see <https://www.gnu.org/licenses/>.
 
   <link rel="shortcut icon" href="/favicon.ico" />
 
-  <meta name="description" content="Welcome to LightOff! Let everyone surf by a confortable gray light and imageless!"/>
+  <meta name="description" content="Welcome to LightOff! Let everyone surf by a confortable gray light!"/>
   <meta name="keywords" content="LightOff,free,surf,imageless"/>
   <meta name="robots" content="index,follow"/>
   <meta name="author" content="5 Mode"/>
@@ -56,14 +56,14 @@ along with LightOff. If not, see <https://www.gnu.org/licenses/>.
       <br><br><br>
     </div>  
 
-    <input type="url" id="url" name="url" value="https://abcnews.com">&nbsp;<input type="submit" value="GO!"><br>  
+  <input type="url" id="url" name="miourl" value="https://abcnews.com">&nbsp;<input type="submit" value="GO!"><br>  
   
-    <br><br><br>
+  <br><br><br>
   
-    <div style="text-align:center">LightOff was blocked by <b>Wikipedia</b>, off since 1st March 2023</div>
+   <div style="text-align:center;color:red;"><b>ATTENTION</b>: <b>DO NOT use with sensible information</b> like<br> usernames and passwords!</div>
   
     <div id="LIGHTOFFfooterCont">&nbsp;</div>
-    <div id="LIGHTOFFfooter"><span style="background:#FFFFFF; opacity:0.7;">&nbsp;&nbsp;A <a href="http://5mode.com" class="aaa">5 Mode</a> project and <a href="http://demo.5mode.com" class="aaa">WYSIWYG</a> system. Some rights reserved.</span></div>
+    <div id="LIGHTOFFfooter"><span style="background:#FFFFFF; opacity:0.7;">&nbsp;&nbsp;<a href="dd.html" class="aaa">Disclaimer</a>.&nbsp;&nbsp;A <a href="http://5mode.com" class="aaa">5 Mode</a> project and <a href="http://demo.5mode.com" class="aaa">WYSIWYG</a> system. Some rights reserved.</span></div>
         
 </div><!-- content -->    
 
@@ -71,10 +71,15 @@ along with LightOff. If not, see <https://www.gnu.org/licenses/>.
 
 <script src="/js/home.js" type="text/javascript"></script>   
 
+<script>
+document.write("<div id='skinner'></div>");
+$("#skinner").load("/skinner.html");
+</script>
+
 <script>
 document.write("<div id='metrics'></div>");
-$("#metrics").load("/metrics.html");  
-</script>  
-  
+$("#metrics").load("/metrics.html");
+</script>
+
 </body>
-</html>
+</html>

+ 117 - 0
post.php

@@ -0,0 +1,117 @@
+<?PHP
+
+/**
+ * Copyright 2021, 2024 5 Mode
+ *
+ * This file is part of LightOff.
+ *
+ * LightOff is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * LightOff is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.  
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with LightOff. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * surf.php
+ * 
+ * The surfing page.
+ *
+ * @author Daniele Bonini <my25mb@aol.com>
+ * @copyrights (c) 2016, 2024, 5 Mode
+ */
+
+require("config.inc");
+
+$miourl = filter_input(INPUT_GET, "miourl")??"";
+$miourl = strip_tags($miourl);
+//echo($miourl);
+//exit(-1);
+
+if (mb_stripos($miourl, "/google.it/") > 0): ?>
+
+<html>
+ <head>
+ <title>LightOff</title>
+<script src="/js/jquery-3.6.0.min.js" type="text/javascript"></script>
+ </head>  
+<body>
+<div id="content">  
+<form id="frm" action="/surf.php" method="GET">
+<input type="hidden" name="miourl" value="<?PHP echo($miourl);?>"> 
+  <?PHP foreach($_POST as $key => $val):?>
+  <input type="hidden" name="<?PHP echo($key);?>" value="<?PHP echo($val);?>">  
+<?PHP Endforeach;?>
+<?PHP foreach($_GET as $key => $val):?>
+<?PHP if ($key !== "miourl"): ?>  
+  <input type="hidden" name="<?PHP echo($key);?>" value="<?PHP echo($val);?>">  
+<?PHP endif; ?>    
+<?PHP Endforeach;?>  
+</form>
+</div> 
+<script>
+frm.submit();  
+</script>  
+</body>  
+</html>  
+
+<?PHP elseif (mb_stripos($miourl, "/it.search.yahoo.com/") > 0): ?>
+
+<html>
+ <head>
+ <title>LightOff</title>
+<script src="/js/jquery-3.6.0.min.js" type="text/javascript"></script>
+ </head>  
+<body>
+<div id="content">  
+<form id="frm" action="/surf.php" method="GET">
+<input type="hidden" name="miourl" value="<?PHP echo($miourl);?>"> 
+  <?PHP foreach($_POST as $key => $val):?>
+  <input type="hidden" name="<?PHP echo($key);?>" value="<?PHP echo($val);?>">  
+<?PHP Endforeach;?>
+<?PHP foreach($_GET as $key => $val):?>
+<?PHP if ($key !== "miourl"): ?>  
+  <input type="hidden" name="<?PHP echo($key);?>" value="<?PHP echo($val);?>">  
+<?PHP endif; ?>    
+<?PHP Endforeach;?>  
+</form>
+</div> 
+<script>
+frm.submit();  
+</script>  
+</body>  
+</html>  
+
+<?PHP else: ?>
+
+<html>
+ <head>
+ <title>LightOff</title>
+<script src="/js/jquery-3.6.0.min.js" type="text/javascript"></script>
+ </head>  
+<body>
+<div id="content">  
+<form id="frm" action="/surf.php" method="GET">
+<input type="hidden" name="miourl" value="<?PHP echo($miourl);?>"> 
+  <?PHP foreach($_POST as $key => $val):?>
+  <input type="hidden" name="<?PHP echo($key);?>" value="<?PHP echo($val);?>">  
+<?PHP Endforeach;?>
+<?PHP foreach($_GET as $key => $val):?>
+<?PHP if ($key !== "miourl"): ?>  
+  <input type="hidden" name="<?PHP echo($key);?>" value="<?PHP echo($val);?>">  
+<?PHP endif; ?>    
+<?PHP Endforeach;?>  
+</form>
+</div> 
+<script>
+frm.submit();  
+</script>  
+</body>  
+</html>  
+
+<?PHP Endif; ?>

+ 41 - 7
surf.php

@@ -30,7 +30,7 @@ require("config.inc");
 
 echo("<div style='top:5px;font-weight:900;background-color:#FFFFFF;'>&nbsp;LIGHTOFF&nbsp;&nbsp;(<a href='http://github.com/par7133/LightOff' target='_blank'>on github</a>)</div><br><br>");
 
-$url = filter_input(INPUT_GET, "url")??"";
+$url = filter_input(INPUT_GET, "miourl")??"";
 $url = strip_tags($url);
 //echo($url."<br>");
 if ($url == "") {
@@ -54,6 +54,17 @@ if (substr($url, 0, 4) === "http") {
 } 
 //echo($domain."<br>");
 
+// xxx
+if (mb_stripos($url, "?") === false) {
+  $url = $url . "?miot=t";
+}
+foreach($_GET as $key=>$val) {
+  if ($key !== "miourl") {
+    $url = $url . "&$key=" . urlencode($val);  
+  }  
+}
+// end xxx
+
 $file = fopen($url, "r");
 if (!$file) {
     echo "<p>404 LightOff url doesn't exist.</p>\n";
@@ -106,17 +117,40 @@ $body = preg_replace('/href="(.{6}(?<!http:\/)(?<!https:)(?<!ftp:\/\/).+)"/iU',
 $body = preg_replace("/href='(.{6}(?<!http:\/)(?<!https:)(?<!ftp:\/\/).+)'/iU", "href='".$domain."/$1'", $body);
 //$body = preg_replace("/href=(.{6}(?<!http:\/)(?<!https:)(?<!ftp:\/\/).+)/iU", "href='".$domain."/$1'", $body);
 
-$body = str_ireplace('action="//', 'action="'.APP_HOST.'/surf.php?url=https://', $body);
-$body = str_ireplace('action="/', 'action="'.APP_HOST.'/surf.php?url='.$domain.'/', $body);
-$body = preg_replace('/action="(.{6}(?<!http:\/)(?<!https:)(?<!ftp:\/\/).+)"/iU', "action=\"".APP_HOST."/surf.php?url=".$domain."/$1\"", $body); 
-$body = preg_replace("/action='(.{6}(?<!http:\/)(?<!https:)(?<!ftp:\/\/).+)'/iU", "action='".APP_HOST."/surf.php?url=".$domain."/$1'", $body);
+//$body = str_ireplace('action="//', 'action="'.APP_HOST.'/surf.php?url=https://', $body);
+//$body = str_ireplace('action="/', 'action="'.APP_HOST.'/surf.php?url='.$domain.'/', $body);
+//$body = str_ireplace('action="//', 'action="https://', $body);
+//$body = str_ireplace('action="/', 'action="'.$domain.'/', $body);
+$body = str_ireplace('action="https://', 'action="'.APP_HOST.'/post.php?miourl=https://', $body);
+$body = str_ireplace('action="//', 'action="'.APP_HOST.'/post.php?miourl=https://', $body);
+$body = str_ireplace('action="/', 'action="'.APP_HOST.'/post.php?miourl='.$domain.'/', $body);
+$body = preg_replace('/action="(.{6}(?<!http:\/)(?<!https:)(?<!ftp:\/\/).+)"/iU', "action=\"".APP_HOST."/post.php?miourl=".$domain."/$1\"", $body); 
+$body = preg_replace("/action='(.{6}(?<!http:\/)(?<!https:)(?<!ftp:\/\/).+)'/iU", "action='".APP_HOST."/post.php?miourl=".$domain."/$1'", $body);
+
+$body = str_ireplace('<form', '<form method="POST"', $body);
+$body = str_ireplace('method="GET', 'method="POST', $body);
+//$body = str_ireplace('</form>', "<input name=\"miourl\" type=\"hidden\"></form>", $body);
+
+//YAHOO
+if ((mb_stripos($url, "yahoo.it")!==false) || (mb_stripos($url, "yahoo.com")!==false))  {
+  $ipos = mb_stripos($body, '<div id="doc"');
+  if ($ipos !== false) {
+    $body = substr($body,$ipos);
+  }
+}
 
-$body = preg_replace('/href="(.+)"/iU', "href=\"".APP_HOST."/surf.php?url=$1\"", $body); 
+$body = preg_replace('/href="(.+)"/iU', "href=\"".APP_HOST."/surf.php?miourl=$1\"", $body); 
 
 $w = $head . $body;
 
 echo($w);    
 
+//YAHOO
+if (mb_stripos($miourl, "yahoo.it")!==false) {
+//  echo("<div style='clear:both'>&nbsp;</div><br><br><br><br><br><br><br><br><br>");
+}
+
+
 ?>
 
- 
+