Skip to content

Commit

Permalink
Make the varible for the profile name more descriptive and clean the …
Browse files Browse the repository at this point in the history
…label
  • Loading branch information
Tim Almdal committed Jan 28, 2010
1 parent 75aec29 commit c51fe96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions modules/gallery/helpers/gallery_event.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -404,14 +404,14 @@ static function show_user_profile($data) {
if (!$data->display_all) { if (!$data->display_all) {
$fields = array("name" => t("Name"), "full_name" => t("Full name"), "url" => "Web site"); $fields = array("name" => t("Name"), "full_name" => t("Full name"), "url" => "Web site");
} }
$v->fields = array(); $v->user_profile_data = array();
foreach ($fields as $field => $label) { foreach ($fields as $field => $label) {
if (!empty($data->user->$field)) { if (!empty($data->user->$field)) {
$value = $data->user->$field; $value = $data->user->$field;
if ($field == "locale") { if ($field == "locale") {
$value = locales::display_name($value); $value = locales::display_name($value);
} }
$v->fields[(string) $label] = $value; $v->user_profile_data[(string) $label] = $value;
} }
} }
$data->content[] = (object) array("title" => t("User information"), "view" => $v); $data->content[] = (object) array("title" => t("User information"), "view" => $v);
Expand Down
1 change: 0 additions & 1 deletion modules/gallery/tests/xss_data.txt
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ modules/gallery/views/upgrader.html.php 102 DIRTY_ATTR $don
modules/gallery/views/user_languages_block.html.php 2 DIRTY form::dropdown("g-select-session-locale",$installed_locales,$selected) modules/gallery/views/user_languages_block.html.php 2 DIRTY form::dropdown("g-select-session-locale",$installed_locales,$selected)
modules/gallery/views/user_profile.html.php 35 DIRTY_ATTR $user->avatar_url(40,$theme->url(,true)) modules/gallery/views/user_profile.html.php 35 DIRTY_ATTR $user->avatar_url(40,$theme->url(,true))
modules/gallery/views/user_profile.html.php 46 DIRTY $info->view modules/gallery/views/user_profile.html.php 46 DIRTY $info->view
modules/gallery/views/user_profile_info.html.php 5 DIRTY $field
modules/image_block/views/image_block_block.html.php 3 DIRTY_JS $item->url() modules/image_block/views/image_block_block.html.php 3 DIRTY_JS $item->url()
modules/image_block/views/image_block_block.html.php 4 DIRTY $item->thumb_img(array("class"=>"g-thumbnail")) modules/image_block/views/image_block_block.html.php 4 DIRTY $item->thumb_img(array("class"=>"g-thumbnail"))
modules/info/views/info_block.html.php 22 DIRTY date("M j, Y H:i:s",$item->captured) modules/info/views/info_block.html.php 22 DIRTY date("M j, Y H:i:s",$item->captured)
Expand Down
4 changes: 2 additions & 2 deletions modules/gallery/views/user_profile_info.html.php
Original file line number Original file line Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php defined("SYSPATH") or die("No direct script access.") ?> <?php defined("SYSPATH") or die("No direct script access.") ?>
<table> <table>
<? foreach ($fields as $field => $value): ?> <? foreach ($user_profile_data as $label => $value): ?>
<tr> <tr>
<td><?= $field ?></td> <td><?= html::clean($label) ?></td>
<td><?= html::purify($value) ?></td> <td><?= html::purify($value) ?></td>
</tr> </tr>
<? endforeach ?> <? endforeach ?>
Expand Down

0 comments on commit c51fe96

Please sign in to comment.