Changeset 4104

Show
Ignore:
Timestamp:
02/29/08 11:57:09 (10 months ago)
Author:
jmathis
Message:

remove vulnerability and send header of image/png

Location:
branches/centreon-1.4.2.4/www/include/doc
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • branches/centreon-1.4.2.4/www/include/doc/get_image.php

    r3857 r4104  
    1515For information : contact@oreon-project.org 
    1616*/ 
     17         
     18        $img = filter_var($_GET["img"], FILTER_SANITIZE_SPECIAL_CHARS); 
     19        $img = filter_var($img, INPUT_GET); 
    1720 
    18         $tab = split("/", $_GET["img"]); 
    19         foreach ($tab as $img){ 
    20                 $image = $img; 
    21         } 
    22         $img = fopen("../../../doc/".$_GET["lang"]."/images/".$image, "r");      
    23         while ($line = fgets($img)){ 
    24                 print $line; 
     21        $lang = filter_var($_GET["lang"], FILTER_SANITIZE_SPECIAL_CHARS); 
     22        $lang = filter_var($lang, INPUT_GET); 
     23 
     24 
     25        $tab_images = split("/", $img); 
     26        foreach ($tab_images as $value) 
     27                $image = $value; 
     28         
     29        header("Content-Type: image/png"); 
     30         
     31        if (file_exists("../../../doc/".$lang."/images/".$image)){ 
     32                $img = fopen("../../../doc/".$lang."/images/".$image, "r");      
     33                if (isset($img) && $img) 
     34                        while ($line = fgets($img)) 
     35                                print $line; 
    2536        } 
    2637?> 
  • branches/centreon-1.4.2.4/www/include/doc/index.php

    r3498 r4104  
    4040                        $line = preg_replace("/\<strong\>/", "<strong style=\"padding-left:20px;\">", $line); 
    4141                        $line = preg_replace("/\<p\>/", "<p style=\"text-align:justify;padding-left:20px;padding-right:10px;padding-top:5px;padding-bottom:10px;\">", $line); 
    42                         $line = preg_replace("/\<img src\=\"images\//", "<img src=./include/doc/get_image.php?lang=".$oreon->user->get_lang()."&img=", $line); 
     42                        $line = preg_replace("/\<img src\=\"images\//", "<img src=\"./include/doc/get_image.php?lang=".$oreon->user->get_lang()."&img=", $line); 
    4343                        $line = preg_replace("/\<table border\=\"0\"/", "<table border=\"1\"", $line); 
    4444                        print $line;