Raza448 / php-excel-reader

Automatically exported from code.google.com/p/php-excel-reader
0 stars 0 forks source link

Improper Hyperlinks #93

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Add a hyperlink to some data in your excel sheet
2. View it on the website
3.

What is the expected output? What do you see instead?
The hyperlink should point to correct address. Instead it is appended to 
current url and shows junk characters.

Please provide any additional information below.
The problem can be observed at http://appliedgel.appliedbioscience.com/exstock/
The hyperlink shows up properly when I view the source but on the page it does 
not display properly.

Original issue reported on code.google.com by mehul.n....@gmail.com on 13 Oct 2010 at 5:41

GoogleCodeExporter commented 8 years ago
same thing happens with the example file 
http://appliedgel.appliedbioscience.com/excelreader.php

Original comment by mehul.n....@gmail.com on 13 Oct 2010 at 5:52

GoogleCodeExporter commented 8 years ago
hi,

It's maybe a little late but i found a fix for your problem.
If you checked the sourch you should see that Font-Family has exactly the same 
problem.

At line 388, you should see: 
if($link){
   return $link['link'];
}

Replace that by:
if ($link) {
    $link ['desc'] = urlencode($link ['desc']);
    $link ['desc'] = str_replace("%00", "", $link ['desc']);
    $link ['desc'] = str_replace("%3A", ":", $link ['desc']);
    $link ['desc'] = str_replace("%2F", "/", $link ['desc']);
    $link ['desc'] = str_replace("%3F", "?", $link ['desc']);
    $link ['desc'] = str_replace("%3D", "=", $link ['desc']);
    $link ['desc'] = str_replace("%2E", ".", $link ['desc']);
    $link ['desc'] = str_replace("%2D", "-", $link ['desc']);

    $link ['link'] = urlencode($link ['link']);
    $link ['link'] = str_replace("%00", "", $link ['link']);
    $link ['link'] = str_replace("%3A", ":", $link ['link']);
    $link ['link'] = str_replace("%2F", "/", $link ['link']);
    $link ['link'] = str_replace("%3F", "?", $link ['link']);
    $link ['link'] = str_replace("%3D", "=", $link ['link']);
    $link ['link'] = str_replace("%2E", ".", $link ['link']);
    $link ['link'] = str_replace("%2D", "-", $link ['link']);

    return $link ['link'];
}

Now the link part is fixed!
The fix for the font-family is below this.

At line 436 you should see:

if ($font != "") {
    $css .= "font-family:$font;";
}

Replace it by:

if ($font != "") {
    $font = urlencode($font);
    $font = str_replace("%00", "", $font);
    $css .= "font-family:$font;";
}

Now that is fixed too!

Good Luck!

Original comment by s.buijsr...@gmail.com on 13 Mar 2012 at 4:09

GoogleCodeExporter commented 8 years ago
Could you post the file please?

Original comment by endar...@gmail.com on 13 Mar 2012 at 6:22