We have moved to Github. Please open tickets there.

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#2463 closed Enhancement (fixed)

Always normalize urls

Reported by: ewinslow Owned by: ewinslow
Priority: low Milestone: Elgg 1.8.0
Component: Core Version: 1.7
Severity: trivial Keywords:
Cc: brettp, hellekin@… Difficulty: easy

Description

forward() has this nice property where if I forward to 'pg/some/page' it knows to prepend my site root before forwarding. This should happen everywhere.

  • adding menu items
  • output/url
  • output/confirmlink
  • others?

Change History (19)

comment:1 Changed 3 years ago by brettp

  • Difficulty set to easy
  • Priority changed from normal to low
  • Severity changed from minor to trivial

Create an elgg_normalize_url() function.

comment:2 Changed 3 years ago by ewinslow

  • Owner set to ewinslow
  • Status changed from new to assigned

comment:3 Changed 3 years ago by ewinslow

(In [svn:7194]) Refs #2463: Added elgg_normalize_url. forward() and add_menu() make use of it

comment:4 Changed 3 years ago by ewinslow

(In [svn:7195]) Refs #2463: Removed some gratuitous calls to elgg_get_site_url() from core plugins

comment:5 Changed 3 years ago by ewinslow

(In [svn:7196]) Refs #2463: Removed stay { that was causing the regexp to break

comment:6 Changed 3 years ago by ewinslow

(In [svn:7197]) Refs #2463: input/form now normalizes the action parameter

comment:7 Changed 3 years ago by ewinslow

(In [svn:7198]) Refs #2463: Removed many more graituitous calls to elgg_get_site_url(), $CONFIG->url, etc.

comment:8 Changed 3 years ago by ewinslow

(In [svn:7199]) Refs #2463: Added url normalization support to output/url, output/confirmlink. Enhanced normalization to take care of urls like "example.com"

comment:9 Changed 3 years ago by ewinslow

(In [svn:7200]) Refs #2463: Removed some more instances of $CONFIG->url. Added support for elgg_normalize_url to elgg_add_action_tokens_to_url

comment:10 Changed 3 years ago by ewinslow

(In [svn:7201]) Refs #2463: Fixed typo of elgg_normalize_url function

comment:11 Changed 3 years ago by ewinslow

(In [svn:7202]) Refs #2463: page_elements/content_header normalizes 'new_link'

comment:12 Changed 3 years ago by ewinslow

(In [svn:7203]) Refs #2463: Added URL normalization support for entity and extender url handlers

comment:13 Changed 3 years ago by ewinslow

(In [svn:7204]) Refs #2463: Removed gratuitous references to $CONFIG->url, etc. in blog - groups plugins

comment:14 Changed 3 years ago by ewinslow

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [svn:7205]) Fixes #2463: Removed gratuitous references to $CONFIG->url, etc. from the rest of the plugins.

comment:15 Changed 3 years ago by brettp

  • Resolution fixed deleted
  • Status changed from closed to reopened

As of [svn:7223] this isn't working correctly for the profile plugin. The topbar icon doesn't have the correctly URL.

comment:16 Changed 3 years ago by hellekin

  • Cc hellekin@… added

Adding a carret at the beginning of the regexp on line 264 of source:engine/lib/output.php fixes the issue. See pull request on github.

comment:17 Changed 3 years ago by ewinslow

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [svn:7236]) Fixes #2463: Added to beginning of normalize_url regex to prevent matching on urls like mod/plugin/page.php. Added unit tests to verify functionality.

comment:18 Changed 3 years ago by brettp

(In [svn:7237]) Refs #2463 Added trim for leading /s to avoid s when passing elgg_normalize_url('/mod/some/file.php').

comment:19 Changed 3 years ago by ewinslow

(In [svn:7238]) Fixes #2463: Added support for forwarding to root-level files, e.g. forward('install.php')

Note: See TracTickets for help on using tickets.