Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into rawphoto-squash

  • Loading branch information...
commit 521a682837ab5b035d63160ea7b22540f3adf7b1 2 parents 20d7bfd + 771de0a
@chadparry chadparry authored
View
2  .build_number
@@ -3,4 +3,4 @@
; process. You don't need to edit it. In fact..
;
; DO NOT EDIT THIS FILE BY HAND!
-build_number=153
+build_number=160
View
5 modules/g2_import/controllers/admin_g2_import.php
@@ -60,6 +60,11 @@ public function index() {
array("url" => url::site("admin/modules"), "module_id" => $module_id)));
}
}
+ if (module::is_active("akismet")) {
+ message::warning(
+ t("The Akismet module may mark some or all of your imported comments as spam. <a href=\"%url\">Deactivate</a> it to avoid that outcome.",
+ array("url" => url::site("admin/modules"))));
+ }
} else if (g2_import::is_configured()) {
$view->content->form->configure_g2_import->embed_path->add_error("invalid", 1);
}
View
27 modules/g2_import/helpers/g2_import.php
@@ -908,9 +908,13 @@ static function import_comment(&$queue) {
array("id" => $g2_comment_id, "exception" => (string)$e));
}
- if (self::map($g2_comment->getId())) {
- // Already imported
- return;
+ if ($id = self::map($g2_comment->getId())) {
+ if (ORM::factory("comment", $id)->loaded()) {
+ // Already imported and still exists
+ return;
+ }
+ // This comment was already imported, but now it no longer exists. Import it again, per
+ // ticket #1736.
}
$item_id = self::map($g2_comment->getParentId());
@@ -948,10 +952,11 @@ static function import_comment(&$queue) {
self::set_map($g2_comment->getId(), $comment->id, "comment");
// Backdate the creation date. We can't do this at creation time because
- // Comment_Model::save() will override it.
+ // Comment_Model::save() will override it. Leave the updated date alone
+ // so that if the comments get marked as spam, they don't immediately get
+ // flushed (see ticket #1736)
db::update("comments")
->set("created", $g2_comment->getDate())
- ->set("updated", $g2_comment->getDate())
->where("id", "=", $comment->id)
->execute();
}
@@ -1292,6 +1297,7 @@ static function map($g2_id) {
* Associate a Gallery 2 id with a Gallery 3 item id.
*/
static function set_map($g2_id, $g3_id, $resource_type, $g2_url=null) {
+ self::clear_map($g2_id, $resource_type);
$g2_map = ORM::factory("g2_map");
$g2_map->g3_id = $g3_id;
$g2_map->g2_id = $g2_id;
@@ -1306,6 +1312,17 @@ static function set_map($g2_id, $g3_id, $resource_type, $g2_url=null) {
self::$map[$g2_id] = $g3_id;
}
+ /**
+ * Remove all map entries associated with the given Gallery 2 id.
+ */
+ static function clear_map($g2_id, $resource_type) {
+ db::build()
+ ->delete("g2_maps")
+ ->where("g2_id", "=", $g2_id)
+ ->where("resource_type", "=", $resource_type)
+ ->execute();
+ }
+
static function log($msg) {
message::warning($msg);
Kohana_Log::add("alert", $msg);
View
17 modules/gallery/helpers/encoding.php
@@ -19,13 +19,16 @@
*/
class encoding_Core {
static function convert_to_utf8($value) {
- if (function_exists("mb_detect_encoding") &&
- function_exists("mb_convert_encoding") &&
- mb_detect_encoding($value, "ISO-8859-1, UTF-8") != "UTF-8") {
- $value = mb_convert_encoding($value, "UTF-8", mb_detect_encoding($value));
- } else if (function_exists("mb_detect_encoding") &&
- mb_detect_encoding($value, "ISO-8859-1, UTF-8") != "UTF-8") {
- $value = utf8_encode($value);
+ if (function_exists("mb_detect_encoding")) {
+ // Rely on mb_detect_encoding()'s strict mode
+ $src_encoding = mb_detect_encoding($value, mb_detect_order(), true);
+ if ($src_encoding != "UTF-8") {
+ if (function_exists("mb_convert_encoding") && $src_encoding) {
+ $value = mb_convert_encoding($value, "UTF-8", $src_encoding);
+ } else {
+ $value = utf8_encode($value);
+ }
+ }
}
return $value;
}
View
2  modules/gallery/tests/System_Helper_Test.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2011 Chad Parry
+ * Copyright (C) 2000-2011 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
View
92 modules/gallery/tests/xss_data.txt
@@ -5,21 +5,22 @@ modules/comment/views/admin_block_recent_comments.html.php 4 DIRTY_ATTR text
modules/comment/views/admin_block_recent_comments.html.php 5 DIRTY_ATTR $comment->author()->avatar_url(32,$theme->url(,true))
modules/comment/views/admin_block_recent_comments.html.php 10 DIRTY gallery::date_time($comment->created)
modules/comment/views/admin_comments.html.php 5 DIRTY $form
-modules/comment/views/admin_manage_comments.html.php 43 DIRTY $menu->render()
-modules/comment/views/admin_manage_comments.html.php 107 DIRTY_ATTR $comment->id
-modules/comment/views/admin_manage_comments.html.php 107 DIRTY_ATTR text::alternate("g-odd","g-even")
-modules/comment/views/admin_manage_comments.html.php 110 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true))
-modules/comment/views/admin_manage_comments.html.php 123 DIRTY_JS $item->url()
-modules/comment/views/admin_manage_comments.html.php 125 DIRTY_ATTR $item->thumb_url()
-modules/comment/views/admin_manage_comments.html.php 127 DIRTY photo::img_dimensions($item->thumb_width,$item->thumb_height,75)
-modules/comment/views/admin_manage_comments.html.php 135 DIRTY gallery::date($comment->created)
-modules/comment/views/admin_manage_comments.html.php 142 DIRTY_JS $comment->id
-modules/comment/views/admin_manage_comments.html.php 151 DIRTY_JS $comment->id
-modules/comment/views/admin_manage_comments.html.php 160 DIRTY_JS $comment->id
-modules/comment/views/admin_manage_comments.html.php 169 DIRTY_JS $comment->id
-modules/comment/views/admin_manage_comments.html.php 176 DIRTY_JS $comment->id
-modules/comment/views/admin_manage_comments.html.php 184 DIRTY_JS $comment->id
-modules/comment/views/admin_manage_comments.html.php 197 DIRTY $pager
+modules/comment/views/admin_manage_comments.html.php 45 DIRTY $menu->render()
+modules/comment/views/admin_manage_comments_queue.html.php 40 DIRTY $theme->paginator()
+modules/comment/views/admin_manage_comments_queue.html.php 55 DIRTY_ATTR $comment->id
+modules/comment/views/admin_manage_comments_queue.html.php 55 DIRTY_ATTR text::alternate("g-odd","g-even")
+modules/comment/views/admin_manage_comments_queue.html.php 58 DIRTY_ATTR $comment->author()->avatar_url(40,$fallback_avatar_url)
+modules/comment/views/admin_manage_comments_queue.html.php 75 DIRTY_JS $item->url()
+modules/comment/views/admin_manage_comments_queue.html.php 77 DIRTY_ATTR $item->thumb_url()
+modules/comment/views/admin_manage_comments_queue.html.php 79 DIRTY photo::img_dimensions($item->thumb_width,$item->thumb_height,75)
+modules/comment/views/admin_manage_comments_queue.html.php 87 DIRTY gallery::date($comment->created)
+modules/comment/views/admin_manage_comments_queue.html.php 94 DIRTY_JS $comment->id
+modules/comment/views/admin_manage_comments_queue.html.php 103 DIRTY_JS $comment->id
+modules/comment/views/admin_manage_comments_queue.html.php 116 DIRTY_JS $comment->id
+modules/comment/views/admin_manage_comments_queue.html.php 125 DIRTY_JS $comment->id
+modules/comment/views/admin_manage_comments_queue.html.php 132 DIRTY_JS $comment->id
+modules/comment/views/admin_manage_comments_queue.html.php 141 DIRTY_JS $comment->id
+modules/comment/views/admin_manage_comments_queue.html.php 155 DIRTY $theme->paginator()
modules/comment/views/comment.html.php 2 DIRTY_ATTR $comment->id;
modules/comment/views/comment.html.php 5 DIRTY_ATTR $comment->author()->avatar_url(40,$theme->url(,true))
modules/comment/views/comment.mrss.php 10 DIRTY $feed->uri
@@ -367,7 +368,7 @@ modules/user/views/admin_users.html.php 73 DIRTY_ATTR $use
modules/user/views/admin_users.html.php 74 DIRTY_ATTR $user->avatar_url(20,$theme->url(,true))
modules/user/views/admin_users.html.php 88 DIRTY ($user->last_login==0)?"":gallery::date($user->last_login)
modules/user/views/admin_users.html.php 91 DIRTY db::build()->from("items")->where("owner_id","=",$user->id)->count_records()
-modules/user/views/admin_users.html.php 113 DIRTY $pager
+modules/user/views/admin_users.html.php 113 DIRTY $theme->paginator()
modules/user/views/admin_users.html.php 132 DIRTY_ATTR $group->id
modules/user/views/admin_users.html.php 132 DIRTY_ATTR ($group->special?"g-default-group":"")
modules/user/views/admin_users.html.php 134 DIRTY $v
@@ -378,31 +379,30 @@ modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $wid
modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $height
modules/watermark/views/admin_watermarks.html.php 20 DIRTY_ATTR $url
themes/admin_wind/views/admin.html.php 4 DIRTY $theme->html_attributes()
-themes/admin_wind/views/admin.html.php 33 DIRTY $theme->admin_head()
-themes/admin_wind/views/admin.html.php 42 DIRTY_JS $theme->url()
-themes/admin_wind/views/admin.html.php 47 DIRTY $theme->get_combined("css")
-themes/admin_wind/views/admin.html.php 50 DIRTY $theme->get_combined("script")
-themes/admin_wind/views/admin.html.php 54 DIRTY $theme->admin_page_top()
-themes/admin_wind/views/admin.html.php 62 DIRTY $theme->admin_header_top()
-themes/admin_wind/views/admin.html.php 63 DIRTY_JS item::root()->url()
-themes/admin_wind/views/admin.html.php 66 DIRTY $theme->user_menu()
-themes/admin_wind/views/admin.html.php 69 DIRTY $theme->admin_menu()
-themes/admin_wind/views/admin.html.php 72 DIRTY $theme->admin_header_bottom()
-themes/admin_wind/views/admin.html.php 79 DIRTY $content
-themes/admin_wind/views/admin.html.php 85 DIRTY $sidebar
-themes/admin_wind/views/admin.html.php 90 DIRTY $theme->admin_footer()
-themes/admin_wind/views/admin.html.php 93 DIRTY $theme->admin_credits()
-themes/admin_wind/views/admin.html.php 98 DIRTY $theme->admin_page_bottom()
+themes/admin_wind/views/admin.html.php 34 DIRTY $theme->admin_head()
+themes/admin_wind/views/admin.html.php 46 DIRTY_JS $theme->url()
+themes/admin_wind/views/admin.html.php 51 DIRTY $theme->get_combined("css")
+themes/admin_wind/views/admin.html.php 54 DIRTY $theme->get_combined("script")
+themes/admin_wind/views/admin.html.php 58 DIRTY $theme->admin_page_top()
+themes/admin_wind/views/admin.html.php 66 DIRTY $theme->admin_header_top()
+themes/admin_wind/views/admin.html.php 67 DIRTY_JS item::root()->url()
+themes/admin_wind/views/admin.html.php 70 DIRTY $theme->user_menu()
+themes/admin_wind/views/admin.html.php 73 DIRTY $theme->admin_menu()
+themes/admin_wind/views/admin.html.php 76 DIRTY $theme->admin_header_bottom()
+themes/admin_wind/views/admin.html.php 83 DIRTY $content
+themes/admin_wind/views/admin.html.php 89 DIRTY $sidebar
+themes/admin_wind/views/admin.html.php 94 DIRTY $theme->admin_footer()
+themes/admin_wind/views/admin.html.php 97 DIRTY $theme->admin_credits()
+themes/admin_wind/views/admin.html.php 102 DIRTY $theme->admin_page_bottom()
themes/admin_wind/views/block.html.php 3 DIRTY_ATTR $anchor
themes/admin_wind/views/block.html.php 5 DIRTY $id
themes/admin_wind/views/block.html.php 5 DIRTY_ATTR $css_id
themes/admin_wind/views/block.html.php 13 DIRTY $title
themes/admin_wind/views/block.html.php 16 DIRTY $content
-themes/admin_wind/views/pager.html.php 13 DIRTY_JS str_replace('{page}',1,$url)
-themes/admin_wind/views/pager.html.php 20 DIRTY_JS str_replace('{page}',$previous_page,$url)
-themes/admin_wind/views/pager.html.php 27 DIRTY $from_to_msg
-themes/admin_wind/views/pager.html.php 30 DIRTY_JS str_replace('{page}',$next_page,$url)
-themes/admin_wind/views/pager.html.php 37 DIRTY_JS str_replace('{page}',$last_page,$url)
+themes/admin_wind/views/paginator.html.php 35 DIRTY_JS $first_page_url
+themes/admin_wind/views/paginator.html.php 44 DIRTY_JS $previous_page_url
+themes/admin_wind/views/paginator.html.php 70 DIRTY_JS $next_page_url
+themes/admin_wind/views/paginator.html.php 79 DIRTY_JS $last_page_url
themes/wind/views/album.html.php 16 DIRTY_ATTR $child->id
themes/wind/views/album.html.php 16 DIRTY_ATTR $item_class
themes/wind/views/album.html.php 18 DIRTY_JS $child->url()
@@ -430,16 +430,16 @@ themes/wind/views/page.html.php 17 DIRTY item::
themes/wind/views/page.html.php 32 DIRTY $new_width
themes/wind/views/page.html.php 33 DIRTY $new_height
themes/wind/views/page.html.php 34 DIRTY $thumb_proportion
-themes/wind/views/page.html.php 71 DIRTY_JS $theme->url()
-themes/wind/views/page.html.php 76 DIRTY $theme->get_combined("css")
-themes/wind/views/page.html.php 79 DIRTY $theme->get_combined("script")
-themes/wind/views/page.html.php 89 DIRTY $header_text
-themes/wind/views/page.html.php 91 DIRTY_JS item::root()->url()
-themes/wind/views/page.html.php 95 DIRTY $theme->user_menu()
-themes/wind/views/page.html.php 116 DIRTY_JS $parent->url($parent->id==$theme->item()->parent_id?"show={$theme->item()->id}":null)
-themes/wind/views/page.html.php 137 DIRTY $content
-themes/wind/views/page.html.php 143 DIRTY newView("sidebar.html")
-themes/wind/views/page.html.php 150 DIRTY $footer_text
+themes/wind/views/page.html.php 74 DIRTY_JS $theme->url()
+themes/wind/views/page.html.php 79 DIRTY $theme->get_combined("css")
+themes/wind/views/page.html.php 82 DIRTY $theme->get_combined("script")
+themes/wind/views/page.html.php 92 DIRTY $header_text
+themes/wind/views/page.html.php 94 DIRTY_JS item::root()->url()
+themes/wind/views/page.html.php 98 DIRTY $theme->user_menu()
+themes/wind/views/page.html.php 119 DIRTY_JS $parent->url($parent->id==$theme->item()->parent_id?"show={$theme->item()->id}":null)
+themes/wind/views/page.html.php 140 DIRTY $content
+themes/wind/views/page.html.php 146 DIRTY newView("sidebar.html")
+themes/wind/views/page.html.php 153 DIRTY $footer_text
themes/wind/views/paginator.html.php 33 DIRTY_JS $first_page_url
themes/wind/views/paginator.html.php 42 DIRTY_JS $previous_page_url
themes/wind/views/paginator.html.php 70 DIRTY_JS $next_page_url
View
2  modules/tag/tests/Tag_Test.php
@@ -18,7 +18,7 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Tag_Test extends Gallery_Unit_Test_Case {
- public function teardown() {
+ public function setup() {
ORM::factory("tag")->delete_all();
}
View
3  modules/user/controllers/password.php
@@ -18,6 +18,9 @@
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Password_Controller extends Controller {
+ const ALLOW_MAINTENANCE_MODE = true;
+ const ALLOW_PRIVATE_GALLERY = true;
+
public function reset() {
$form = self::_reset_form();
if (request::method() == "post") {
View
84 themes/admin_wind/css/screen-rtl.css
@@ -92,7 +92,11 @@ input[type=radio] {
padding-right: 0;
}
-input.checkbox {
+input.checkbox,
+input[type="checkbox"],
+input.radio,
+input[type="radio"] {
+ margin-right: 0;
margin-left: .4em;
}
@@ -109,6 +113,14 @@ input.checkbox {
margin-right: .2em;
}
+.g-group h4 {
+ padding: .5em .5em .5em 0;
+}
+
+.g-group .g-user {
+ padding: .2em .5em 0 0;
+}
+
/* RTL Corner radius ~~~~~~~~~~~~~~~~~~~~~~ */
.g-buttonset .ui-corner-tl {
@@ -275,6 +287,10 @@ ul.sf-menu li li li.sfHover ul {
right: auto;
}
+.ui-tabs .ui-tabs-nav li {
+ float: right;
+}
+
#g-content #g-album-grid .g-item,
#g-site-theme,
#g-admin-theme,
@@ -286,6 +302,11 @@ li.g-group,
float: right;
}
+#g-site-theme {
+ margin-right: 0;
+ margin-left: 1em;
+}
+
#g-admin-graphics .g-available .g-block {
float: right;
margin-left: 1em;
@@ -316,3 +337,64 @@ li.g-group,
.g-available .g-block img {
margin: 0 0 1em 1em;
}
+
+.g-button {
+ margin: 0 0 0 4px;
+}
+
+/* RTL paginator ~~~~~~~~~~~~~~~~~~~~~~~~~~ */
+
+.g-paginator .g-info {
+ width: 35%;
+}
+
+.g-paginator .g-text-right {
+ margin-left: 0;
+}
+
+.g-paginator .ui-icon-seek-end {
+ background-position: -80px -160px;
+}
+
+.g-paginator .ui-icon-seek-next {
+ background-position: -48px -160px;
+}
+
+.g-paginator .ui-icon-seek-prev {
+ background-position: -32px -160px;
+}
+
+.g-paginator .ui-icon-seek-first {
+ background-position: -64px -160px;
+}
+
+#g-header #g-login-menu,
+#g-header #g-quick-search-form {
+ clear: left;
+ float: left;
+}
+
+#g-header #g-login-menu li {
+ margin-left: 0;
+ padding-left: 0;
+ padding-right: 1.2em;
+}
+
+#g-site-menu {
+ left: auto;
+ right: 240px;
+}
+
+#g-view-menu #g-slideshow-link {
+ background-image: url('../images/ico-view-slideshow-rtl.png');
+}
+
+#g-sidebar .g-block-content {
+ padding-right: 1em;
+ padding-left: 0;
+}
+
+#g-footer #g-credits li {
+ padding-left: 1.2em !important;
+ padding-right: 0;
+}
View
1  themes/wind/css/screen-rtl.css
@@ -275,7 +275,6 @@ ul.sf-menu li li li.sfHover ul {
right: auto;
}
-
/* RTL paginator ~~~~~~~~~~~~~~~~~~~~~~~~~~ */
.g-paginator .g-info {
Please sign in to comment.
Something went wrong with that request. Please try again.