PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » File Formats » Spreadsheet_Excel_Writer » Bug #9605

Enhancement in external link handling

Details

Request #9605Enhancement in external link handling
Submitted2006-12-13 14:11 UTC
Fromdischinger at vdi dot de
StatusOpen
PackageSpreadsheet_Excel_Writer
PHP VersionIrrelevant
OSIrrelevant
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 }