Home » File Formats » Spreadsheet_Excel_Writer » Bug #9605
Enhancement in external link handling
Details
| Request #9605 | Enhancement in external link handling |
|---|---|
| Submitted | 2006-12-13 14:11 UTC |
| From | dischinger at vdi dot de |
| Status | Open |
| Package | Spreadsheet_Excel_Writer |
| PHP Version | Irrelevant |
| OS | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2006-12-13 14:11 UTC] dischinger at vdi dot de
Description:
------------
File "Worksheet.php", line 2023-2036
// Determine if the external link is relative or absolute:
// relative if link contains no dir separator, "somefile.xls"
// relative if link starts with up-dir, "..\..\somefile.xls"
// otherwise, absolute
A relative external link starting from the current directory is not recognized as relative link, e.g. ".\data\somefile.xls"
Test script:
---------------
// Determine if the link is relative or absolute:
// relative if link contains no dir separator, "somefile.xls"
// relative if link starts with up-dir, "..\..\somefile.xls"
ADDED // relative if link starts with acutal dir ".\data\somefile.xls"
// otherwise, absolute
$absolute = 0x02; // Bit mask
if (!preg_match("/\\\/", $url)) {
$absolute = 0x00;
}
if (preg_match("/^\.\.\\\/", $url)) {
$absolute = 0x00;
}
ADDED if (preg_match("/^\.\\\/", $url)) {
ADDED $absolute = 0x00;
ADDED }