Ticket #237 (closed Bug: fixed)

Opened 11 months ago

Last modified 11 months ago

html::file_anchor ignores 4th attribute 'protocol'

Reported by: brettalton Owned by:
Priority: major Milestone: 2.1
Component: Core Version: SVN HEAD
Keywords: html, helpre, file_anchor, protocol Cc:

Description

As I was writing the documentation for the 'html' helper at doc.kohanaphp.com and making examples, I noticed that html::file_anchor ignores the 4th attribute 'protocol'.

Code:

	public static function file_anchor($file, $title = FALSE, $attributes = FALSE, $protocol = FALSE)
	{
		return
		// Base URL + URI = full URL
		'<a href="'.url::base(FALSE).$file.'"'
		// Attributes empty? Use an empty string
		.(empty($attributes) ? '' : self::attributes($attributes)).'>'
		// Title empty? Use the filename part of the URI
		.(empty($title) ? end(explode('/', $file)) : $title) .'</a>';
	}

Call:

echo html::file_anchor('pub/index.html', 'The Public Linux Archive', 'id="id432"', 'ftp');

Returns:

<a href="http://localhost/pub/index.html" id="id432">The Public Linux Archive</a>

Notice the lack of the ftp:// prefix.

Change History

Changed 11 months ago by Geert

  • status changed from new to closed
  • resolution set to fixed

Fixed in r1258.

Note: See TracTickets for help on using tickets.