Skip to content
This repository was archived by the owner on Nov 7, 2020. It is now read-only.
This repository was archived by the owner on Nov 7, 2020. It is now read-only.

Broken links at /api_generator/api_files/files #20

Open
@ghost

Description

Created by Bancer, 13th Sep 2012. (originally Lighthouse ticket #94):


The method produces broken links on Windows
public function fileLink($filename, $url = array(), $attributes = array()) {
$url = array_merge($this->_defaultUrl['file'], $url);
$trimmedFile = $this->trimFileName($filename);
if (!empty($trimmedFile) && $trimmedFile != $filename) {
$url = array_merge($url, explode('/', $trimmedFile));
return $this->Html->link($trimmedFile, $url, $attributes);
}
return $filename;
}

Therefore it must to be corrected:

public function fileLink($filename, $url = array(), $attributes = array()) {
    $url = array_merge($this->_defaultUrl['file'], $url);
    $trimmedFile = $this->trimFileName($filename);
    if (!empty($trimmedFile) && $trimmedFile != $filename) {
        $url = array_merge($url, explode(DIRECTORY_SEPARATOR, $trimmedFile));
        return $this->Html->link($trimmedFile, $url, $attributes);
    }
    return $filename;
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions