diff options
22 files changed, 88 insertions, 76 deletions
diff --git a/modules/gallery/css/l10n_client.css b/modules/gallery/css/l10n_client.css index dd8d5c5d..bab1d0ed 100644 --- a/modules/gallery/css/l10n_client.css +++ b/modules/gallery/css/l10n_client.css @@ -159,6 +159,8 @@ how it wants to round. */ #l10n-client-string-editor .source .source-text { line-height:1.5em; background:#eee; + font-family: monospace; + text-align: left; height:16em; margin:1em; padding:1em; overflow:auto; direction: ltr; diff --git a/modules/gallery/helpers/gallery_menu.php b/modules/gallery/helpers/gallery_menu.php index 854086c1..9729a868 100644 --- a/modules/gallery/helpers/gallery_menu.php +++ b/modules/gallery/helpers/gallery_menu.php @@ -100,12 +100,6 @@ class gallery_menu_Core { ->url("#") ->css_class("gFullSizeLink")); } - $menu - ->append(Menu::factory("link") - ->id("album") - ->label(t("Return to album")) - ->url($theme->item()->parent()->url("show={$theme->item->id}")) - ->css_id("gAlbumLink")); } static function admin($menu, $theme) { diff --git a/modules/gallery/tests/xss_data.txt b/modules/gallery/tests/xss_data.txt index e3dbb188..b71262df 100644 --- a/modules/gallery/tests/xss_data.txt +++ b/modules/gallery/tests/xss_data.txt @@ -283,8 +283,11 @@ modules/image_block/views/image_block_block.html.php 4 DIRTY $item->th modules/info/views/info_block.html.php 6 $item->title modules/info/views/info_block.html.php 11 $item->description modules/info/views/info_block.html.php 17 $item->name -modules/info/views/info_block.html.php 23 DIRTY $item->captured -modules/info/views/info_block.html.php 29 $item->owner->name +modules/info/views/info_block.html.php 25 DIRTY $parent->id +modules/info/views/info_block.html.php 25 DIRTY $item->id +modules/info/views/info_block.html.php 26 $parent->title +modules/info/views/info_block.html.php 34 DIRTY $item->captured +modules/info/views/info_block.html.php 40 $item->owner->name modules/notification/views/comment_published.html.php 4 $subject modules/notification/views/comment_published.html.php 7 $subject modules/notification/views/comment_published.html.php 11 $comment->text @@ -339,9 +342,9 @@ modules/organize/views/organize_thumb_grid.html.php 7 DIRTY $child->i modules/organize/views/organize_thumb_grid.html.php 8 DIRTY $child->id modules/organize/views/organize_thumb_grid.html.php 8 DIRTY $item_class modules/organize/views/organize_thumb_grid.html.php 9 DIRTY $child->thumb_img(array("class" => "gThumbnail"), $thumbsize, true) -modules/recaptcha/views/admin_recaptcha.html.php 5 DIRTY $form->get_key_url -modules/recaptcha/views/admin_recaptcha.html.php 8 DIRTY $form -modules/recaptcha/views/admin_recaptcha.html.php 21 DIRTY $public_key +modules/recaptcha/views/admin_recaptcha.html.php 6 DIRTY $form->get_key_url +modules/recaptcha/views/admin_recaptcha.html.php 10 DIRTY $form +modules/recaptcha/views/admin_recaptcha.html.php 23 DIRTY $public_key modules/recaptcha/views/form_recaptcha.html.php 7 DIRTY $public_key modules/rss/views/comment.mrss.php 9 $title modules/rss/views/comment.mrss.php 10 DIRTY $link @@ -470,11 +473,11 @@ modules/user/views/admin_users_group.html.php 22 DIRTY $user->id modules/user/views/admin_users_group.html.php 22 DIRTY $group->id modules/user/views/admin_users_group.html.php 25 $user->name modules/user/views/admin_users_group.html.php 25 $group->name -modules/user/views/login.html.php 11 DIRTY $user->id -modules/user/views/login.html.php 14 $user->full_name -modules/user/views/login.html.php 14 $user->name -modules/user/views/login.html.php 14 $user->full_name -modules/user/views/login.html.php 15 DIRTY $csrf +modules/user/views/login.html.php 12 DIRTY $user->id +modules/user/views/login.html.php 15 $user->full_name +modules/user/views/login.html.php 15 $user->name +modules/user/views/login.html.php 15 $user->full_name +modules/user/views/login.html.php 18 DIRTY $csrf modules/user/views/login_ajax.html.php 37 DIRTY $form modules/user/views/reset_password.html.php 9 $user->full_name modules/user/views/reset_password.html.php 9 $user->full_name diff --git a/modules/gallery/views/admin_theme_details.html.php b/modules/gallery/views/admin_theme_details.html.php index eb450b16..f093b70b 100644 --- a/modules/gallery/views/admin_theme_details.html.php +++ b/modules/gallery/views/admin_theme_details.html.php @@ -1,6 +1,6 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <div id="gAdminThemeDetails"> - <h1> <?= t("Theme Details") ?> </h1> + <h1> <?= t("Theme Options") ?> </h1> <?= $form ?> </div> diff --git a/modules/gallery/views/admin_themes.html.php b/modules/gallery/views/admin_themes.html.php index f85bce70..dc13a6a0 100644 --- a/modules/gallery/views/admin_themes.html.php +++ b/modules/gallery/views/admin_themes.html.php @@ -7,7 +7,7 @@ } </script> -<h1> <?= t("Theme Administration") ?> </h1> +<h1> <?= t("Theme Choice") ?> </h1> <p> <?= t("Gallery allows you to choose a theme for browsing your Gallery, as well as a special theme for the administration interface. Click a theme to preview and activate it.") ?> </p> diff --git a/modules/gallery/views/l10n_client.html.php b/modules/gallery/views/l10n_client.html.php index faa6e939..2e53f48f 100644 --- a/modules/gallery/views/l10n_client.html.php +++ b/modules/gallery/views/l10n_client.html.php @@ -16,7 +16,7 @@ [other] - <?= $string["source"]["other"] ?> <? else: ?> <?= $string["source"] ?> - <? endif; ?> + <? endif; ?> </li> <? endforeach; ?> </ul> @@ -25,7 +25,7 @@ </div> <div id="l10n-client-string-editor"> <div class="source"> - <pre class="source-text"></pre> + <p class="source-text"></p> </div> <div class="translation"> <form method="post" action="<?= url::site("l10n_client/save") ?>" id="gL10nClientSaveForm"> diff --git a/modules/info/views/info_block.html.php b/modules/info/views/info_block.html.php index db664894..f8e5f35e 100644 --- a/modules/info/views/info_block.html.php +++ b/modules/info/views/info_block.html.php @@ -17,6 +17,17 @@ <td><?= p::clean($item->name) ?></td> </tr> <? endif ?> + <? if ($item->id != 1): ?> + <? $parent = $item->parent(); ?> + <tr> + <th><?= t("Album: ") ?></th> + <td> + <a href="<?= url::site("albums/{$parent->id}?show=$item->id") ?>"> + <?= p::clean($parent->title) ?> + </a> + </td> + </tr> + <? endif ?> <? if ($item->captured): ?> <tr> <th><?= t("Captured:") ?></th> diff --git a/modules/notification/helpers/notification_menu.php b/modules/notification/helpers/notification_menu.php index 87927874..696aad62 100644 --- a/modules/notification/helpers/notification_menu.php +++ b/modules/notification/helpers/notification_menu.php @@ -18,19 +18,21 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class notification_menu_Core { - static function album($menu, $theme) { + static function site($menu, $theme) { if (!user::active()->guest) { $item = $theme->item(); - - if ($item) { + + if ($item && $item->is_album()) { $watching = notification::is_watching($item); - $menu + $watching ? $label = t("Remove notifications") : $label = t("Enable notifications"); + + $menu->get("options_menu") ->append(Menu::factory("link") ->id("watch") - ->label(t("Enable notifications for this album")) - ->url(url::site("notification/watch/$item->id?csrf=" . access::csrf_token())) - ->css_id($watching ? "gRemoveNotifyLink" : "gAddNotifyLink")); + ->label($label) + ->css_id("gNotifyLink") + ->url(url::site("notification/watch/$item->id?csrf=" . access::csrf_token()))); } } } diff --git a/modules/recaptcha/views/admin_recaptcha.html.php b/modules/recaptcha/views/admin_recaptcha.html.php index ed90aea9..74932a96 100644 --- a/modules/recaptcha/views/admin_recaptcha.html.php +++ b/modules/recaptcha/views/admin_recaptcha.html.php @@ -2,7 +2,9 @@ <div id="gAdminRecaptcha"> <h1> <?= t("ReCaptcha Challenge Filtering") ?> </h1> <p> - <?= t("Recaptcha is a free CAPTCHA service that helps to digitize books, newspapers and old time radio shows. automated spam filtering service. In order to use it, you need to sign up for a <a href=\"{$form->get_key_url}\">ReCaptcha Public/Private Key pair</a>, which is also free. Once registered, the the challenge and response strings are evaluated at <a href=\"%url\">recaptcha.net</a> to determine if the form content has been entered by a bot.", array("url" => "http://recaptcha.net")) ?> + <?= t("Recaptcha is a free CAPTCHA service that helps to digitize books, newspapers and old time radio shows. automated spam filtering service. In order to use it, you need to sign up for a <a href=\"%domain_url\">ReCaptcha Public/Private Key pair</a>, which is also free. Once registered, the challenge and response strings are evaluated at <a href=\"%recaptcha_url\">recaptcha.net</a> to determine if the form content has been entered by a bot.", + array("domain_url" => $form->get_key_url, + "recaptcha_url" => "http://recaptcha.net")) ?> </p> <?= $form ?> diff --git a/modules/user/controllers/password.php b/modules/user/controllers/password.php index 3b0eac66..2dde11b8 100644 --- a/modules/user/controllers/password.php +++ b/modules/user/controllers/password.php @@ -19,9 +19,9 @@ */ class Password_Controller extends Controller { public function reset() { - access::verify_csrf(); - if (request::method() == "post") { + // @todo separate the post from get parts of this function + access::verify_csrf(); $this->_send_reset(); } else { print $this->_reset_form(); diff --git a/modules/user/views/login.html.php b/modules/user/views/login.html.php index 3889f06e..7617d131 100644 --- a/modules/user/views/login.html.php +++ b/modules/user/views/login.html.php @@ -1,18 +1,22 @@ <?php defined("SYSPATH") or die("No direct script access.") ?> <ul id="gLoginMenu"> <? if ($user->guest): ?> - <li class="first"><a href="<?= url::site("login/ajax") ?>" - title="<?= t("Login to Gallery") ?>" - id="gLoginLink"><?= t("Login") ?></a></li> + <li class="first"> + <a href="<?= url::site("login/ajax") ?>" + title="<?= t("Login to Gallery") ?>" + id="gLoginLink"><?= t("Login") ?></a> + </li> <? else: ?> - <li class="first"><?= - t('Logged in as %name', - array('name' => - '<a href="' . url::site("form/edit/users/{$user->id}") . - '" title="' . t("Edit Your Profile") . - '" id="gUserProfileLink" class="gDialogLink">' . - p::clean(empty($user->full_name) ? $user->name : $user->full_name) . '</a>')) ?></li> - <li><a href="<?= url::site("logout?csrf=$csrf&continue=" . url::current(true)) ?>" - id="gLogoutLink"><?= t("Logout") ?></a></li> - <? endif; ?> + <li class="first"> + <?= t('Logged in as %name', array('name' => + '<a href="' . url::site("form/edit/users/{$user->id}") . + '" title="' . t("Edit Your Profile") . + '" id="gUserProfileLink" class="gDialogLink">' . + p::clean(empty($user->full_name) ? $user->name : $user->full_name) . '</a>')) ?> + </li> + <li> + <a href="<?= url::site("logout?csrf=$csrf&continue=" . url::current(true)) ?>" + id="gLogoutLink"><?= t("Logout") ?></a> + </li> + <? endif ?> </ul> diff --git a/system/core/Event.php b/system/core/Event.php index 90944c37..06468a8d 100644 --- a/system/core/Event.php +++ b/system/core/Event.php @@ -4,7 +4,7 @@ * to be added to 'events'. Events can be run multiple times, and can also * process event-specific data. By default, Kohana has several system events. * - * $Id: Event.php 4358 2009-05-27 17:24:25Z ixmatus $ + * $Id: Event.php 4390 2009-06-04 03:05:36Z zombor $ * * @package Core * @author Kohana Team @@ -206,7 +206,7 @@ final class Event { foreach ($callbacks as $callback) { - call_user_func_array($callback, array(&$data)); + call_user_func($callback); } // Do this to prevent data from getting 'stuck' diff --git a/system/helpers/html.php b/system/helpers/html.php index 9ad20d89..2c609567 100644 --- a/system/helpers/html.php +++ b/system/helpers/html.php @@ -2,7 +2,7 @@ /** * HTML helper class. * - * $Id: html.php 4368 2009-05-27 21:58:51Z samsoir $ + * $Id: html.php 4376 2009-06-01 11:40:39Z samsoir $ * * @package Core * @author Kohana Team @@ -68,15 +68,21 @@ class html_Core { * @param string link text * @param array HTML anchor attributes * @param string non-default protocol, eg: https + * @param boolean option to escape the title that is output * @return string */ - public static function anchor($uri, $title = NULL, $attributes = NULL, $protocol = NULL) + public static function anchor($uri, $title = NULL, $attributes = NULL, $protocol = NULL, $escape_title = FALSE) { if ($uri === '') { $site_url = url::base(FALSE); } - elseif (strpos($uri, '://') === FALSE AND strpos($uri, '#') !== 0) + elseif (strpos($uri, '#') === 0) + { + // This is an id target link, not a URL + $site_url = $uri; + } + elseif (strpos($uri, '://') === FALSE) { $site_url = url::site($uri, $protocol); } @@ -96,7 +102,7 @@ class html_Core { // Attributes empty? Use an empty string .(is_array($attributes) ? html::attributes($attributes) : '').'>' // Title empty? Use the parsed URL - .html::specialchars((($title === NULL) ? $site_url : $title), FALSE).'</a>'; + .($escape_title ? html::specialchars((($title === NULL) ? $site_url : $title), FALSE) : (($title === NULL) ? $site_url : $title)).'</a>'; } /** diff --git a/system/libraries/Profiler.php b/system/libraries/Profiler.php index 47d82ace..9da053fb 100644 --- a/system/libraries/Profiler.php +++ b/system/libraries/Profiler.php @@ -8,7 +8,7 @@ * POST Data - The name and values of any POST data submitted to the current page. * Cookie Data - All cookies sent for the current request. * - * $Id: Profiler.php 4090 2009-03-19 01:27:45Z bharat $ + * $Id: Profiler.php 4383 2009-06-03 00:17:24Z ixmatus $ * * @package Profiler * @author Kohana Team @@ -104,7 +104,7 @@ class Profiler_Core { $view = new View('kohana_profiler', $data); // Return rendered view if $return is TRUE - if ($return == TRUE) + if ($return === TRUE) return $view->render(); // Add profiler data to the output diff --git a/system/libraries/Router.php b/system/libraries/Router.php index 6dc9b10c..ef0e1e47 100644 --- a/system/libraries/Router.php +++ b/system/libraries/Router.php @@ -2,7 +2,7 @@ /** * Router * - * $Id: Router.php 4350 2009-05-14 18:58:18Z zombor $ + * $Id: Router.php 4391 2009-06-04 03:10:12Z zombor $ * * @package Core * @author Kohana Team @@ -213,17 +213,17 @@ class Router_Core { elseif (isset($_SERVER['PHP_SELF']) AND $_SERVER['PHP_SELF']) { Router::$current_uri = $_SERVER['PHP_SELF']; - - if (($strpos_fc = strpos(Router::$current_uri, KOHANA)) !== FALSE) - { - // Remove the front controller from the current uri - Router::$current_uri = substr(Router::$current_uri, $strpos_fc + strlen(KOHANA)); - } } - + + if (($strpos_fc = strpos(Router::$current_uri, KOHANA)) !== FALSE) + { + // Remove the front controller from the current uri + Router::$current_uri = (string) substr(Router::$current_uri, $strpos_fc + strlen(KOHANA)); + } + // Remove slashes from the start and end of the URI Router::$current_uri = trim(Router::$current_uri, '/'); - + if (Router::$current_uri !== '') { if ($suffix = Kohana::config('core.url_suffix') AND strpos(Router::$current_uri, $suffix) !== FALSE) diff --git a/system/libraries/drivers/Database/Mssql.php b/system/libraries/drivers/Database/Mssql.php index 6947679a..8b5ed50b 100644 --- a/system/libraries/drivers/Database/Mssql.php +++ b/system/libraries/drivers/Database/Mssql.php @@ -298,7 +298,7 @@ class Database_Mssql_Driver extends Database_Driver public function field_data($table) { - $query = $this->query('SHOW COLUMNS FROM '.$this->escape_table($table), $this->link); + $query = $this->query("SELECT COLUMN_NAME AS Field, DATA_TYPE as Type FROM INFORMATION_SCHEMA.Columns WHERE TABLE_NAME = '".$this->escape_table($table)."'", $this->link); return $query->result_array(TRUE); } diff --git a/themes/admin_default/views/admin.html.php b/themes/admin_default/views/admin.html.php index 5f6e3457..721c4dd5 100644 --- a/themes/admin_default/views/admin.html.php +++ b/themes/admin_default/views/admin.html.php @@ -4,7 +4,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> - <title>G3: Admin Dashboard</title> + <title><?= t("Admin Dashboard") ?></title> <link rel="shortcut icon" href="<?= url::file("themes/default/images/favicon.ico") ?>" type="image/x-icon" /> <link rel="stylesheet" type="text/css" href="<?= url::file("lib/yui/reset-fonts-grids.css") ?>" media="screen,projection" /> @@ -42,8 +42,8 @@ <div id="gHeader"> <?= $theme->admin_header_top() ?> <ul id="gLoginMenu"> - <li class="first"><?= html::anchor("albums/1", "Browse the Gallery") ?></li> - <li id="gLogoutLink"><a href="<?= url::site("logout?continue=albums/1&csrf=$csrf") ?>">Logout</a></li> + <li class="first"><?= html::anchor("albums/1", t("Browse the Gallery")) ?></li> + <li id="gLogoutLink"><a href="<?= url::site("logout?continue=albums/1&csrf=$csrf") ?>"><?= t("Logout") ?></a></li> </ul> <a href="<?= url::site("albums/1") ?>"><img src="<?= url::file("themes/default/images/logo.png") ?>" id="gLogo" alt="<?= t("Gallery 3: Your Photos on Your Web Site") ?>" /></a> <div id="gSiteAdminMenu" style="display: none"> diff --git a/themes/default/css/screen.css b/themes/default/css/screen.css index b591a5be..f306f287 100644 --- a/themes/default/css/screen.css +++ b/themes/default/css/screen.css @@ -649,18 +649,6 @@ form .gError, width: 43px !important; } -#gViewMenu #gAlbumLink { - background-image: url('../images/ico-view-album.png'); -} - -#gViewMenu #gAddNotifyLink { - background-image: url('../images/ico-notify-add.png'); -} - -#gViewMenu #gRemoveNotifyLink { - background-image: url('../images/ico-notify-remove.png'); -} - #gViewMenu #gHybridLink { background-image: url('../images/ico-view-hybrid.png'); } diff --git a/themes/default/images/avatar.jpg b/themes/default/images/avatar.jpg Binary files differindex 2e76b12b..acad9314 100644 --- a/themes/default/images/avatar.jpg +++ b/themes/default/images/avatar.jpg diff --git a/themes/default/images/ico-notify-add.png b/themes/default/images/ico-notify-add.png Binary files differdeleted file mode 100644 index 937bfd4f..00000000 --- a/themes/default/images/ico-notify-add.png +++ /dev/null diff --git a/themes/default/images/ico-notify-remove.png b/themes/default/images/ico-notify-remove.png Binary files differdeleted file mode 100644 index 8c0f29ca..00000000 --- a/themes/default/images/ico-notify-remove.png +++ /dev/null diff --git a/themes/default/images/ico-view-album.png b/themes/default/images/ico-view-album.png Binary files differdeleted file mode 100644 index 20b5af20..00000000 --- a/themes/default/images/ico-view-album.png +++ /dev/null |