Changeset 151

Show
Ignore:
Timestamp:
11/30/08 21:38:03 (1 year ago)
Author:
cedenoj
Message:

fixes #2833 The profile module now uses PARAM_SAFEDIR as defined in lib/constants.php to allow usernames that include underscores. This should allow the dino users to view and create their profiles. The .htaccess file was also modified so that dino users get pretty urls as well.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • elgg/trunk/.htaccess

    r117 r151  
    8383########### 
    8484RewriteRule ^content\/?(.*)?$ mod/pages/index.php?owner=-1&page=$1 [QSA,L] 
    85 RewriteRule ^([A-Za-z0-9]+)\/content\/(.*)?$ mod/pages/index.php?profile_name=$1&page=$2  [QSA,L] 
     85RewriteRule ^([A-Za-z0-9_]+)\/content\/(.*)?$ mod/pages/index.php?profile_name=$1&page=$2  [QSA,L] 
    8686 
    8787RewriteRule ^_templates(\/)?$ mod/template/index.php?%{QUERY_STRING} 
     
    9292RewriteRule ^(.+)\/rssstyles.xsl$ mod/newsclient/styles.php?rssurl=$1&url=$1 
    9393 
    94 RewriteRule ^([A-Za-z0-9]+)\/dashboard(\/)?$ mod/adash/index.php?user=$1 
    95  
    96 RewriteRule ^([A-Za-z0-9]+)\/profile(\/)?$ profile/index.php?profile_name=$1 
    97 RewriteRule ^([A-Za-z0-9]+)\/tags(\/)?$ search/personaltags.php?profile_name=$1 
    98 RewriteRule ^([A-Za-z0-9]+)\/rss\/(.+)\/?$ profile/rss2.php?profile_name=$1&tag=$2 
     94RewriteRule ^([A-Za-z0-9_]+)\/dashboard(\/)?$ mod/adash/index.php?user=$1 
     95 
     96RewriteRule ^([A-Za-z0-9_]+)\/profile(\/)?$ profile/index.php?profile_name=$1 
     97RewriteRule ^([A-Za-z0-9_]+)\/tags(\/)?$ search/personaltags.php?profile_name=$1 
     98RewriteRule ^([A-Za-z0-9_]+)\/rss\/(.+)\/?$ profile/rss2.php?profile_name=$1&tag=$2 
    9999 
    100100# Invite 
    101101######### 
    102102RewriteRule ^invite\/$ mod/invite/index.php 
    103 ReWriteRule ^invite\/join\/([A-Za-z0-9]+)$ mod/invite/join.php?invitecode=$1 
     103ReWriteRule ^invite\/join\/([A-Za-z0-9_]+)$ mod/invite/join.php?invitecode=$1 
    104104ReWriteRule ^register$ mod/invite/register.php 
    105105RewriteRule ^forgottenpassword$ mod/invite/forgotten_password.php 
    106 RewriteRule ^newpassword\/([A-Za-z0-9]+)$ mod/invite/new_password.php?passwordcode=$1 
    107  
    108 RewriteRule ^([A-Za-z0-9]+)(\/)?$ profile/index.php?profile_name=$1 
     106RewriteRule ^newpassword\/([A-Za-z0-9_]+)$ mod/invite/new_password.php?passwordcode=$1 
     107 
     108RewriteRule ^([A-Za-z0-9_]+)(\/)?$ profile/index.php?profile_name=$1 
    109109 
    110110# Activity 
     
    115115# Communities 
    116116############## 
    117 RewriteRule ^([A-Za-z0-9]+)\/communities\/?$ mod/community/index.php?friends_name=$1 
    118 RewriteRule ^([A-Za-z0-9]+)\/communities\/owned$ mod/community/owned.php?profile_name=$1 
    119 RewriteRule ^([A-Za-z0-9]+)\/communities\/new$ mod/community/new.php?profile_name=$1 
    120 RewriteRule ^([A-Za-z0-9]+)\/community\/delete$ mod/community/index.php?profile_name=$1&action=community:delete 
    121 RewriteRule ^([A-Za-z0-9]+)\/community\/requests$ mod/community/requests.php?profile_name=$1 
    122 RewriteRule ^([A-Za-z0-9]+)\/community\/requests\/aprove\/([0-9]+)$ mod/community/requests.php?profile_name=$1&action=community:approve:request&request_id=$2 
    123 RewriteRule ^([A-Za-z0-9]+)\/community\/requests\/decline\/([0-9]+)$ mod/community/requests.php?profile_name=$1&action=community:decline:request&request_id=$2 
    124 RewriteRule ^([A-Za-z0-9]+)\/community\/members$ mod/community/members.php?profile_name=$1 
    125 RewriteRule ^([A-Za-z0-9]+)\/community\/add\/([0-9]+)$ mod/community/index.php?friends_name=$1&friend_id=$2&action=friend 
    126 RewriteRule ^([A-Za-z0-9]+)\/community\/leave\/([0-9]+)$ mod/community/index.php?profile_name=$1&friend_id=$2&action=leave 
    127 RewriteRule ^([A-Za-z0-9]+)\/community\/separate\/([0-9]+)$ mod/community/members.php?profile_name=$1&friend_id=$2&action=separate 
     117RewriteRule ^([A-Za-z0-9_]+)\/communities\/?$ mod/community/index.php?friends_name=$1 
     118RewriteRule ^([A-Za-z0-9_]+)\/communities\/owned$ mod/community/owned.php?profile_name=$1 
     119RewriteRule ^([A-Za-z0-9_]+)\/communities\/new$ mod/community/new.php?profile_name=$1 
     120RewriteRule ^([A-Za-z0-9_]+)\/community\/delete$ mod/community/index.php?profile_name=$1&action=community:delete 
     121RewriteRule ^([A-Za-z0-9_]+)\/community\/requests$ mod/community/requests.php?profile_name=$1 
     122RewriteRule ^([A-Za-z0-9_]+)\/community\/requests\/aprove\/([0-9]+)$ mod/community/requests.php?profile_name=$1&action=community:approve:request&request_id=$2 
     123RewriteRule ^([A-Za-z0-9_]+)\/community\/requests\/decline\/([0-9]+)$ mod/community/requests.php?profile_name=$1&action=community:decline:request&request_id=$2 
     124RewriteRule ^([A-Za-z0-9_]+)\/community\/members$ mod/community/members.php?profile_name=$1 
     125RewriteRule ^([A-Za-z0-9_]+)\/community\/add\/([0-9]+)$ mod/community/index.php?friends_name=$1&friend_id=$2&action=friend 
     126RewriteRule ^([A-Za-z0-9_]+)\/community\/leave\/([0-9]+)$ mod/community/index.php?profile_name=$1&friend_id=$2&action=leave 
     127RewriteRule ^([A-Za-z0-9_]+)\/community\/separate\/([0-9]+)$ mod/community/members.php?profile_name=$1&friend_id=$2&action=separate 
    128128RewriteRule ^community\/([0-9]+)\/?$ mod/communities/community.php?community_id=$1 
    129 RewriteRule ^([A-Za-z0-9]+)\/community\/invite$ mod/community/invite.php?profile_name=$1 
    130 RewriteRule ^([A-Za-z0-9]+)\/communities\/invitations$ mod/community/user_community_invitations.php?profile_name=$1 
     129RewriteRule ^([A-Za-z0-9_]+)\/community\/invite$ mod/community/invite.php?profile_name=$1 
     130RewriteRule ^([A-Za-z0-9_]+)\/communities\/invitations$ mod/community/user_community_invitations.php?profile_name=$1 
    131131 
    132132# Files 
    133133######## 
    134 RewriteRule ^([A-Za-z0-9]+)\/files\/?$ mod/file/index.php?files_name=$1 
    135 RewriteRule ^([A-Za-z0-9]+)\/files\/([0-9]+)\/?$ mod/file/index.php?files_name=$1&folder=$2 
    136 RewriteRule ^([A-Za-z0-9]+)\/files\/([0-9\-]+)\/([0-9]+)\/(.+)$ mod/file/download.php?files_name=$1&folder=$2&filename=$4&id=$3 
    137 RewriteRule ^(([A-Za-z0-9])[A-Za-z0-9]+)\/files\/rss\/?$ mod/newsclient/static.php?username=$1&userref=$2&type=files 
    138 RewriteRule ^([A-Za-z0-9]+)\/files\/rss\/(.+)\/?$ mod/file/rss2.php?files_name=$1&tag=$2 
     134RewriteRule ^([A-Za-z0-9_]+)\/files\/?$ mod/file/index.php?files_name=$1 
     135RewriteRule ^([A-Za-z0-9_]+)\/files\/([0-9]+)\/?$ mod/file/index.php?files_name=$1&folder=$2 
     136RewriteRule ^([A-Za-z0-9_]+)\/files\/([0-9\-]+)\/([0-9]+)\/(.+)$ mod/file/download.php?files_name=$1&folder=$2&filename=$4&id=$3 
     137RewriteRule ^(([A-Za-z0-9_])[A-Za-z0-9_]+)\/files\/rss\/?$ mod/newsclient/static.php?username=$1&userref=$2&type=files 
     138RewriteRule ^([A-Za-z0-9_]+)\/files\/rss\/(.+)\/?$ mod/file/rss2.php?files_name=$1&tag=$2 
    139139RewriteRule ^_icon\/file/([-0-9]+)$ mod/file/icon.php?id=$1 
    140140RewriteRule ^_files\/icon.php$ mod/file/icon.php?%{QUERY_STRING} 
     
    142142# Friends 
    143143########## 
    144 RewriteRule ^([A-Za-z0-9]+)\/friends\/?$ mod/friend/index.php?friends_name=$1 
    145 RewriteRule ^([A-Za-z0-9]+)\/friendsof\/?$ mod/friend/friendsof.php?friends_name=$1 
    146 RewriteRule ^([A-Za-z0-9]+)\/friends\/requests?$ mod/friend/requests.php?friends_name=$1 
    147 RewriteRule ^([A-Za-z0-9]+)\/foaf\/?$ mod/friend/foaf.php?friends_name=$1 
     144RewriteRule ^([A-Za-z0-9_]+)\/friends\/?$ mod/friend/index.php?friends_name=$1 
     145RewriteRule ^([A-Za-z0-9_]+)\/friendsof\/?$ mod/friend/friendsof.php?friends_name=$1 
     146RewriteRule ^([A-Za-z0-9_]+)\/friends\/requests?$ mod/friend/requests.php?friends_name=$1 
     147RewriteRule ^([A-Za-z0-9_]+)\/foaf\/?$ mod/friend/foaf.php?friends_name=$1 
    148148 
    149149# Icons 
     
    164164# Newsclient 
    165165############ 
    166 RewriteRule ^(([A-Za-z0-9])[A-Za-z0-9]+)\/rss\/?$ mod/newsclient/static.php?username=$1&userref=$2&type=profile 
    167 RewriteRule ^([A-Za-z0-9]+)\/newsclient\/?$ mod/newsclient/subscriptions.php?profile_name=$1 
    168 RewriteRule ^([A-Za-z0-9]+)\/newsclient\/all\/?$ mod/newsclient/index.php?profile_name=$1 
    169 RewriteRule ^([A-Za-z0-9]+)\/newsclient\/all\/skip=([0-9]+)$ mod/newsclient/index.php?profile_name=$1&feed_offset=$2 
    170 RewriteRule ^([A-Za-z0-9]+)\/feeds\/?$ mod/newsclient/subscriptions.php?profile_name=$1 
    171 RewriteRule ^([A-Za-z0-9]+)\/feeds\/all\/?$ mod/newsclient/index.php?profile_name=$1 
    172 RewriteRule ^([A-Za-z0-9]+)\/feeds\/all\/skip=([0-9]+)$ mod/newsclient/index.php?profile_name=$1&feed_offset=$2 
     166RewriteRule ^(([A-Za-z0-9_])[A-Za-z0-9_]+)\/rss\/?$ mod/newsclient/static.php?username=$1&userref=$2&type=profile 
     167RewriteRule ^([A-Za-z0-9_]+)\/newsclient\/?$ mod/newsclient/subscriptions.php?profile_name=$1 
     168RewriteRule ^([A-Za-z0-9_]+)\/newsclient\/all\/?$ mod/newsclient/index.php?profile_name=$1 
     169RewriteRule ^([A-Za-z0-9_]+)\/newsclient\/all\/skip=([0-9]+)$ mod/newsclient/index.php?profile_name=$1&feed_offset=$2 
     170RewriteRule ^([A-Za-z0-9_]+)\/feeds\/?$ mod/newsclient/subscriptions.php?profile_name=$1 
     171RewriteRule ^([A-Za-z0-9_]+)\/feeds\/all\/?$ mod/newsclient/index.php?profile_name=$1 
     172RewriteRule ^([A-Za-z0-9_]+)\/feeds\/all\/skip=([0-9]+)$ mod/newsclient/index.php?profile_name=$1&feed_offset=$2 
    173173RewriteRule ^_rss\/([A-Za-z_]+).php$ mod/newsclient/$1.php?%{QUERY_STRING} 
    174174 
     
    180180# Weblog 
    181181######## 
    182 RewriteRule ^([A-Za-z0-9]+)\/weblog\/?$ mod/blog/index.php?weblog_name=$1 
    183 ReWriteRule ^([A-Za-z0-9]+)\/weblog\/skip=([0-9]+)$ mod/blog/index.php?weblog_name=$1&weblog_offset=$2 
    184 RewriteRule ^([A-Za-z0-9]+)\/weblog\/edit$ mod/blog/edit.php?profile_name=$1 
    185 RewriteRule ^([A-Za-z0-9]+)\/weblog\/edit\/([0-9]+)$ mod/blog/edit.php?profile_name=$1&weblog_post_id=$2&action=edit 
    186 RewriteRule ^([A-Za-z0-9]+)\/weblog\/archive\/?$ mod/blog/archive.php?weblog_name=$1 
    187 RewriteRule ^([A-Za-z0-9]+)\/weblog\/archive\/([0-9]+)\/([0-9]+)\/?$ mod/blog/archive_month.php?weblog_name=$1&year=$2&month=$3 
    188 RewriteRule ^([A-Za-z0-9]+)\/weblog\/friends\/?$ mod/blog/friends.php?weblog_name=$1 
    189 ReWriteRule ^([A-Za-z0-9]+)\/weblog\/friends\/skip=([0-9]+)$ mod/blog/friends.php?weblog_name=$1&weblog_offset=$2 
    190 RewriteRule ^([A-Za-z0-9]+)\/weblog\/interesting\/?$ mod/blog/interesting.php?weblog_name=$1 
    191 ReWriteRule ^([A-Za-z0-9]+)\/weblog\/interesting\/skip=([0-9]+)$ mod/blog/interesting.php?weblog_name=$1&weblog_offset=$2 
    192 RewriteRule ^[A-Za-z0-9]+\/weblog\/([0-9]+)\.html$ mod/blog/view_post.php?post=$1 
    193 RewriteRule ^[A-Za-z0-9]+\/weblog\/([0-9]+)\.html.([0-9]+)$ mod/blog/view_post.php?post=$1&commentpage=$2 
    194 RewriteRule ^([A-Za-z0-9]+)\/weblog\/rss\/(.+)\/?$ mod/blog/rss2.php?weblog_name=$1&tag=$2&modifier=is 
    195 RewriteRule ^([A-Za-z0-9]+)\/weblog\/rssnot\/(.+)\/?$ mod/blog/rss2.php?weblog_name=$1&tag=$2&modifier=not 
    196 RewriteRule ^(([A-Za-z0-9])[A-Za-z0-9]+)\/weblog\/rss\/?$ mod/newsclient/static.php?username=$1&userref=$2&type=weblog 
    197 RewriteRule ^([A-Za-z0-9]+)\/weblog\/category\/([^\/]+)\/?$ mod/blog/index.php?weblog_name=$1&filter=$2 
    198 ReWriteRule ^([A-Za-z0-9]+)\/weblog\/category\/([^\/]+)\/skip=([0-9]+)$ mod/blog/index.php?weblog_name=$1&filter=$2&weblog_offset=$3 
     182RewriteRule ^([A-Za-z0-9_]+)\/weblog\/?$ mod/blog/index.php?weblog_name=$1 
     183ReWriteRule ^([A-Za-z0-9_]+)\/weblog\/skip=([0-9]+)$ mod/blog/index.php?weblog_name=$1&weblog_offset=$2 
     184RewriteRule ^([A-Za-z0-9_]+)\/weblog\/edit$ mod/blog/edit.php?profile_name=$1 
     185RewriteRule ^([A-Za-z0-9_]+)\/weblog\/edit\/([0-9]+)$ mod/blog/edit.php?profile_name=$1&weblog_post_id=$2&action=edit 
     186RewriteRule ^([A-Za-z0-9_]+)\/weblog\/archive\/?$ mod/blog/archive.php?weblog_name=$1 
     187RewriteRule ^([A-Za-z0-9_]+)\/weblog\/archive\/([0-9]+)\/([0-9]+)\/?$ mod/blog/archive_month.php?weblog_name=$1&year=$2&month=$3 
     188RewriteRule ^([A-Za-z0-9_]+)\/weblog\/friends\/?$ mod/blog/friends.php?weblog_name=$1 
     189ReWriteRule ^([A-Za-z0-9_]+)\/weblog\/friends\/skip=([0-9]+)$ mod/blog/friends.php?weblog_name=$1&weblog_offset=$2 
     190RewriteRule ^([A-Za-z0-9_]+)\/weblog\/interesting\/?$ mod/blog/interesting.php?weblog_name=$1 
     191ReWriteRule ^([A-Za-z0-9_]+)\/weblog\/interesting\/skip=([0-9]+)$ mod/blog/interesting.php?weblog_name=$1&weblog_offset=$2 
     192RewriteRule ^[A-Za-z0-9_]+\/weblog\/([0-9]+)\.html$ mod/blog/view_post.php?post=$1 
     193RewriteRule ^[A-Za-z0-9_]+\/weblog\/([0-9]+)\.html.([0-9]+)$ mod/blog/view_post.php?post=$1&commentpage=$2 
     194RewriteRule ^([A-Za-z0-9_]+)\/weblog\/rss\/(.+)\/?$ mod/blog/rss2.php?weblog_name=$1&tag=$2&modifier=is 
     195RewriteRule ^([A-Za-z0-9_]+)\/weblog\/rssnot\/(.+)\/?$ mod/blog/rss2.php?weblog_name=$1&tag=$2&modifier=not 
     196RewriteRule ^(([A-Za-z0-9_])[A-Za-z0-9_]+)\/weblog\/rss\/?$ mod/newsclient/static.php?username=$1&userref=$2&type=weblog 
     197RewriteRule ^([A-Za-z0-9_]+)\/weblog\/category\/([^\/]+)\/?$ mod/blog/index.php?weblog_name=$1&filter=$2 
     198ReWriteRule ^([A-Za-z0-9_]+)\/weblog\/category\/([^\/]+)\/skip=([0-9]+)$ mod/blog/index.php?weblog_name=$1&filter=$2&weblog_offset=$3 
    199199ReWriteRule ^weblog\/everyone$ mod/blog/everyone.php 
    200200ReWriteRule ^weblog\/everyone\/(people|communities|commented|uncommented)$ mod/blog/everyone.php?filter=$1 
     
    210210 
    211211#project modules 
    212 RewriteRule ^([A-Za-z0-9]+)\/projects\/?$ mod/projects/index.php?profile_name=$1 
    213 RewriteRule ^([A-Za-z0-9]+)\/projects\/([A-Za-z0-9]+)\/?$ mod/projects/$2.php?profile_name=$1 
     212RewriteRule ^([A-Za-z0-9_]+)\/projects\/?$ mod/projects/index.php?profile_name=$1 
     213RewriteRule ^([A-Za-z0-9_]+)\/projects\/([A-Za-z0-9_]+)\/?$ mod/projects/$2.php?profile_name=$1 
    214214 
    215215#marketplace module 
    216 RewriteRule ^([A-Za-z0-9]+)\/marketplace\/?$ mod/marketplace/index.php?profile_name=$1 
    217 RewriteRule ^([A-Za-z0-9]+)\/marketplace\/([A-Za-z0-9]+)\/?$ mod/marketplace/$2.php?profile_name=$1 
    218 RewriteRule ^([A-Za-z0-9]+)\/marketplace\/interested\/([A-Za-z0-9]+)\/([A-Za-z0-9]+)\/?$ mod/marketplace/interested.php?profile_name=$1&cat=$2&id=$3 
    219 RewriteRule ^([A-Za-z0-9]+)\/marketplace\/removead\/([A-Za-z0-9]+)\/([A-Za-z0-9]+)\/?$ mod/marketplace/removead.php?profile_name=$1&cat=$2&id=$3 
    220 RewriteRule ^([A-Za-z0-9]+)\/marketplace\/editad\/([A-Za-z0-9]+)\/([A-Za-z0-9]+)\/?$ mod/marketplace/editad.php?profile_name=$1&cat=$2&id=$3 
     216RewriteRule ^([A-Za-z0-9_]+)\/marketplace\/?$ mod/marketplace/index.php?profile_name=$1 
     217RewriteRule ^([A-Za-z0-9_]+)\/marketplace\/([A-Za-z0-9_]+)\/?$ mod/marketplace/$2.php?profile_name=$1 
     218RewriteRule ^([A-Za-z0-9_]+)\/marketplace\/interested\/([A-Za-z0-9_]+)\/([A-Za-z0-9_]+)\/?$ mod/marketplace/interested.php?profile_name=$1&cat=$2&id=$3 
     219RewriteRule ^([A-Za-z0-9_]+)\/marketplace\/removead\/([A-Za-z0-9_]+)\/([A-Za-z0-9_]+)\/?$ mod/marketplace/removead.php?profile_name=$1&cat=$2&id=$3 
     220RewriteRule ^([A-Za-z0-9_]+)\/marketplace\/editad\/([A-Za-z0-9_]+)\/([A-Za-z0-9_]+)\/?$ mod/marketplace/editad.php?profile_name=$1&cat=$2&id=$3 
    221221 
    222222# RewriteRule ^([A-Za-z0-9]+)\/projects\/?$ mod/projects/index.php?profile_name=$1 
  • elgg/trunk/profile/edit.php

    r33 r151  
    1010 
    1111// define what profile to show 
    12 $profile_name = optional_param('profile_name', '', PARAM_ALPHANUM); 
     12$profile_name = optional_param('profile_name', '', PARAM_SAFEDIR); 
    1313if (!empty($profile_name)) { 
    1414    $profile_id = user_info_username('ident', $profile_name); 
  • elgg/trunk/profile/extended.php

    r33 r151  
    88 
    99// define what profile to show 
    10 $profile_name = optional_param('profile_name', '', PARAM_ALPHANUM); 
     10$profile_name = optional_param('profile_name', '', PARAM_SAFEDIR); 
    1111if (!empty($profile_name)) { 
    1212    $profile_id = user_info_username('ident', $profile_name); 
  • elgg/trunk/profile/index.php

    r33 r151  
    88 
    99// define what profile to show 
    10 $profile_name = optional_param('profile_name', '', PARAM_ALPHANUM); 
     10$profile_name = optional_param('profile_name', '', PARAM_SAFEDIR); 
    1111if (!empty($profile_name)) { 
    1212    $profile_id = user_info_username('ident', $profile_name);