diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php index 9fb4796e7c..87633f4ce2 100644 --- a/modules/comment/controllers/comments.php +++ b/modules/comment/controllers/comments.php @@ -39,9 +39,9 @@ public function _index() { foreach ($comments as $comment) { $data[] = array( "id" => $comment->id, - "author_name" => p::clean($comment->author_name()), + "author_name" => SafeString::of($comment->author_name()), "created" => $comment->created, - "text" => nl2br(p::purify($comment->text))); + "text" => nl2br(SafeString::purify($comment->text))); } print json_encode($data); break; @@ -126,9 +126,9 @@ public function _show($comment) { array("result" => "success", "data" => array( "id" => $comment->id, - "author_name" => p::clean($comment->author_name()), + "author_name" => SafeString::of($comment->author_name()), "created" => $comment->created, - "text" => nl2br(p::purify($comment->text))))); + "text" => nl2br(SafeString::purify($comment->text))))); } else { $view = new Theme_View("comment.html", "fragment"); $view->comment = $comment; diff --git a/modules/comment/helpers/comment_rss.php b/modules/comment/helpers/comment_rss.php index ab3d228395..d0f1501080 100644 --- a/modules/comment/helpers/comment_rss.php +++ b/modules/comment/helpers/comment_rss.php @@ -23,7 +23,7 @@ static function available_feeds($item, $tag) { $feeds["comment/newest"] = t("All new comments"); if ($item) { $feeds["comment/item/$item->id"] = - t("Comments on %title", array("title" => p::purify($item->title))); + t("Comments on %title", array("title" => SafeString::purify($item->title))); } return $feeds; } @@ -53,13 +53,13 @@ static function feed($feed_id, $offset, $limit, $id) { $item = $comment->item(); $feed->children[] = new ArrayObject( array("pub_date" => date("D, d M Y H:i:s T", $comment->created), - "text" => nl2br(p::purify($comment->text)), + "text" => nl2br(SafeString::purify($comment->text)), "thumb_url" => $item->thumb_url(), "thumb_height" => $item->thumb_height, "thumb_width" => $item->thumb_width, "item_uri" => url::abs_site("{$item->type}s/$item->id"), - "title" => p::purify($item->title), - "author" => p::clean($comment->author_name())), + "title" => SafeString::purify($item->title), + "author" => SafeString::of($comment->author_name())), ArrayObject::ARRAY_AS_PROPS); } diff --git a/modules/comment/views/admin_block_recent_comments.html.php b/modules/comment/views/admin_block_recent_comments.html.php index 516a818120..2c7a5cf18f 100644 --- a/modules/comment/views/admin_block_recent_comments.html.php +++ b/modules/comment/views/admin_block_recent_comments.html.php @@ -4,13 +4,13 @@
= p::clean($comment->author_name()) ?>
+= SafeString::of($comment->author_name()) ?>
= gallery::date($comment->created) ?>
- = nl2br(p::purify($comment->text)) ?> + = nl2br(SafeString::purify($comment->text)) ?>= nl2br(SafeString::purify($child->text)) ?>
diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php index f725138903..7941b7da4f 100644 --- a/modules/comment/views/comments.html.php +++ b/modules/comment/views/comments.html.php @@ -12,16 +12,16 @@ " class="gAvatar" - alt="= p::clean($comment->author_name()) ?>" + alt="= SafeString::of($comment->author_name()) ?>" width="40" height="40" /> = t('on %date %name said', array("date" => date("Y-M-d H:i:s", $comment->created), - "name" => p::clean($comment->author_name()))); ?> + "name" => SafeString::of($comment->author_name()))); ?>
= p::purify($task->get_log()) ?>+
= SafeString::purify($task->get_log()) ?>
- = t("You're logged in to the %user_name account. The very first thing you should do is to change your password to something that you'll remember.", array("user_name" => p::clean($user->name))) ?> + = t("You're logged in to the %user_name account. The very first thing you should do is to change your password to something that you'll remember.", array("user_name" => $user->name)) ?>
diff --git a/modules/gallery/views/move_tree.html.php b/modules/gallery/views/move_tree.html.php index 5f70cf67d3..7818a42af6 100644 --- a/modules/gallery/views/move_tree.html.php +++ b/modules/gallery/views/move_tree.html.php @@ -1,18 +1,18 @@ = $parent->thumb_img(array(), 25); ?> if (!access::can("edit", $parent) || $source->is_descendant($parent)): ?> - = p::clean($parent->title) ?> = t("(locked)") ?> + = SafeString::of($parent->title) ?> = t("(locked)") ?> else: ?> - = p::clean($parent->title) ?> + = SafeString::of($parent->title) ?> endif ?>
diff --git a/modules/info/views/info_block.html.php b/modules/info/views/info_block.html.php index f86ae39da2..365a1021b3 100644 --- a/modules/info/views/info_block.html.php +++ b/modules/info/views/info_block.html.php @@ -2,18 +2,18 @@
= t("Comment:") ?> | -= nl2br(p::purify($comment->text)) ?> | += nl2br(SafeString::purify($comment->text)) ?> | |||||||||||||||||||||||
= t("Author Name:") ?> | -= p::clean($comment->author_name()) ?> | += SafeString::of($comment->author_name()) ?> | |||||||||||||||||||||||
= t("Author Email:") ?> | -= p::clean($comment->author_email()) ?> | += SafeString::of($comment->author_email()) ?> | |||||||||||||||||||||||
= t("Author URL:") ?> | -= p::clean($comment->author_url()) ?> | += SafeString::of($comment->author_url()) ?> | |||||||||||||||||||||||
= t("Url:") ?> | diff --git a/modules/notification/views/item_added.html.php b/modules/notification/views/item_added.html.php index 8672492706..70b8fca490 100644 --- a/modules/notification/views/item_added.html.php +++ b/modules/notification/views/item_added.html.php @@ -1,14 +1,14 @@ -
= t("Title:") ?> | -= p::purify($item->title) ?> | += SafeString::purify($item->title) ?> |
= t("Url:") ?> | @@ -21,7 +21,7 @@ if ($item->description): ?>||
= t("Description:") ?> | -= nl2br(p::purify($item->description)) ?> | += nl2br(SafeString::purify($item->description)) ?> |
= t("To view the changed album %title use the link below.", - array("title" => p::purify($item->parent()->title))) ?> + array("title" => SafeString::purify($item->parent()->title))) ?> | |||||||||||||||
= t("New Title:") ?> | -= p::clean($item->title) ?> | += SafeString::of($item->title) ?> | else: ?>= t("Title:") ?> | -= p::clean($item->title) ?> | += SafeString::of($item->title) ?> | endif ?>
= t("New Description:") ?> | -= p::clean($item->description) ?> | += SafeString::of($item->description) ?> | |||
= t("Description:") ?> | -= p::clean($item->description) ?> | += SafeString::of($item->description) ?> |
if ($child->type == "photo" || $child->type == "album"): ?>
else: ?>
type}s/{$child->id}") ?>">
endif ?>
- = p::clean($child->description) ?>
+ = SafeString::of($child->description) ?>
- = p::purify($item->title) ?> + = SafeString::purify($item->title) ?>
- = t("No results found for %term", array("term" => p::clean($q))) ?> + = t("No results found for %term", array("term" => $q)) ?>
endif; ?> diff --git a/modules/server_add/controllers/admin_server_add.php b/modules/server_add/controllers/admin_server_add.php index 30109f42b8..fac2aa44fe 100644 --- a/modules/server_add/controllers/admin_server_add.php +++ b/modules/server_add/controllers/admin_server_add.php @@ -38,7 +38,7 @@ public function add_path() { $path = $form->add_path->path->value; $paths[$path] = 1; module::set_var("server_add", "authorized_paths", serialize($paths)); - message::success(t("Added path %path", array("path" => p::clean($path)))); + message::success(t("Added path %path", array("path" => $path))); server_add::check_config($paths); url::redirect("admin/server_add"); } else { @@ -60,7 +60,7 @@ public function remove_path() { $paths = unserialize(module::get_var("server_add", "authorized_paths")); if (isset($paths[$path])) { unset($paths[$path]); - message::success(t("Removed path %path", array("path" => p::clean($path)))); + message::success(t("Removed path %path", array("path" => $path))); module::set_var("server_add", "authorized_paths", serialize($paths)); server_add::check_config($paths); } diff --git a/modules/server_add/views/server_add_tree.html.php b/modules/server_add/views/server_add_tree.html.php index 254a9da090..b68544eccc 100644 --- a/modules/server_add/views/server_add_tree.html.php +++ b/modules/server_add/views/server_add_tree.html.php @@ -24,7 +24,7 @@ endif ?> file="= $file ?>" > - = p::clean(basename($file)) ?> + = SafeString::of(basename($file)) ?> endforeach ?> diff --git a/modules/server_add/views/server_add_tree_dialog.html.php b/modules/server_add/views/server_add_tree_dialog.html.php index 21952849d4..533cad04ad 100644 --- a/modules/server_add/views/server_add_tree_dialog.html.php +++ b/modules/server_add/views/server_add_tree_dialog.html.php @@ -5,17 +5,17 @@= t("Photos will be added to album:") ?>
- = t("Hello, %name,", array("name" => p::clean($user->full_name ? $user->full_name : $user->name))) ?> + = t("Hello, %name,", array("name" => $user->full_name ? $user->full_name : $user->name)) ?>
= t("We received a request to reset your password for %site_url. If you made this request, you can confirm it by clicking this link. If you didn't request this password reset, it's ok to ignore this mail.", array("site_url" => url::base(false, "http"), "confirm_url" => $confirm_url)) ?> diff --git a/system/helpers/request.php b/system/helpers/request.php index 4203d0e56a..15b8edfabd 100644 --- a/system/helpers/request.php +++ b/system/helpers/request.php @@ -30,7 +30,7 @@ public static function referrer($default = FALSE) // Set referrer $ref = $_SERVER['HTTP_REFERER']; - if (strpos($ref, url::base(FALSE)) === 0) + if (strpos($ref, (string) url::base(FALSE)) === 0) { // Remove the base URL from the referrer $ref = substr($ref, strlen(url::base(FALSE))); diff --git a/themes/default/views/album.html.php b/themes/default/views/album.html.php index c2f957318b..ffb4b91314 100644 --- a/themes/default/views/album.html.php +++ b/themes/default/views/album.html.php @@ -2,8 +2,8 @@ // @todo Set hover on AlbumGrid list items for guest users ?>