Links aren't being escaped properly

Project:ProjectPier
Version:0.8.8-alpha
Component:Code
Category:bug report
Priority:normal
Assigned:phpfreak
Status:closed - fixed
Description

Whilst cleaning up layout code for Kamp Pro 2 (https://github.com/dbernar1/kampPro2), I decided to validate the code. Besides my own errors, it said that practically all links were causing errors, because the ampersands in them weren't escaped like `&amp`.

My proposed solution is to borrow the HtmlHelper from CakePHP, and instead of allowing an associative array for a link, allow the paramters for `get_url` (in an array) to be allowed

## Usage:

`$html->link([string $title], mixed $target, [array $options])`;

### $target
Either an array, i.e.
`array('access', 'forgot_password')`, which will be internally translated to `get_url('access', 'forgot_password')`;

or a string
$tabbed_navigation_item->getUrl();

### $options
used for the attributes of the created a-element, i.e.
`$Html->link('title', '#', array('id'=> 'foo', 'class' => 'bar'));` becomes `title`

#1

My apologies for the lack of formatting, I was experiencing issues at first. Then after logging out I forgot to change the input format.

#2

Why borrow such a class? Can we simply reuse it like that or do we need to give credits somewhere?

Why not simply fix the get_url function?

EDIT: I fixed the get_url function in application/functions.php

from this
return with_slash(ROOT_URL) . 'index.php?' . implode('&', $url_params) . $anchor;
to this
return with_slash(ROOT_URL) . 'index.php?' . implode('&', $url_params) . $anchor;

All ampersand validation errors on the login page went away when using the W3C validator.

#3
Assigned to:Visitor» phpfreak
Status:new» closed - fixed

I installed the Chrome Validator Add On and fixed already a number of pages. Most pages look good after the fix above.

#4

...
Indeed an easier solution, hadn't even thought about it myself.