summaryrefslogtreecommitdiff
path: root/modules/comment
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment')
-rw-r--r--modules/comment/controllers/comments.php8
-rw-r--r--modules/comment/helpers/comment_rss.php8
-rw-r--r--modules/comment/views/admin_block_recent_comments.html.php6
-rw-r--r--modules/comment/views/admin_comments.html.php10
-rw-r--r--modules/comment/views/comment.html.php6
-rw-r--r--modules/comment/views/comment.mrss.php12
-rw-r--r--modules/comment/views/comments.html.php6
7 files changed, 28 insertions, 28 deletions
diff --git a/modules/comment/controllers/comments.php b/modules/comment/controllers/comments.php
index 9fb4796e..87633f4c 100644
--- a/modules/comment/controllers/comments.php
+++ b/modules/comment/controllers/comments.php
@@ -39,9 +39,9 @@ class Comments_Controller extends REST_Controller {
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 @@ class Comments_Controller extends REST_Controller {
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 e233de59..4151dcd0 100644
--- a/modules/comment/helpers/comment_rss.php
+++ b/modules/comment/helpers/comment_rss.php
@@ -23,7 +23,7 @@ class comment_rss_Core {
$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;
}
@@ -49,13 +49,13 @@ class comment_rss_Core {
$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 516a8181..2c7a5cf1 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 @@
<li class="<?= ($i % 2 == 0) ? "gEvenRow" : "gOddRow" ?>">
<img src="<?= $comment->author()->avatar_url(32, $theme->url("images/avatar.jpg", true)) ?>"
class="gAvatar"
- alt="<?= p::clean($comment->author_name()) ?>"
+ alt="<?= SafeString::of($comment->author_name()) ?>"
width="32"
height="32" />
<?= gallery::date_time($comment->created) ?>
<?= t('<a href="#">%author_name</a> said <em>%comment_text</em>',
- array("author_name" => p::clean($comment->author_name()),
- "comment_text" => text::limit_words(nl2br(p::purify($comment->text)), 50))); ?>
+ array("author_name" => SafeString::of($comment->author_name()),
+ "comment_text" => text::limit_words(nl2br(SafeString::purify($comment->text)), 50))); ?>
</li>
<? endforeach ?>
</ul>
diff --git a/modules/comment/views/admin_comments.html.php b/modules/comment/views/admin_comments.html.php
index 03511d91..8b0b4c29 100644
--- a/modules/comment/views/admin_comments.html.php
+++ b/modules/comment/views/admin_comments.html.php
@@ -108,12 +108,12 @@
<a href="#">
<img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
class="gAvatar"
- alt="<?= p::clean($comment->author_name()) ?>"
+ alt="<?= SafeString::of($comment->author_name()) ?>"
width="40"
height="40" />
</a>
- <p><a href="mailto:<?= p::clean($comment->author_email()) ?>"
- title="<?= p::clean($comment->author_email()) ?>"> <?= p::clean($comment->author_name()) ?> </a></p>
+ <p><a href="mailto:<?= SafeString::of($comment->author_email()) ?>"
+ title="<?= SafeString::of($comment->author_email()) ?>"> <?= SafeString::of($comment->author_name()) ?> </a></p>
</td>
<td>
<div class="right">
@@ -122,7 +122,7 @@
<a href="<?= $item->url() ?>">
<? if ($item->has_thumb()): ?>
<img src="<?= $item->thumb_url() ?>"
- alt="<?= p::purify($item->title) ?>"
+ alt="<?= SafeString::purify($item->title) ?>"
<?= photo::img_dimensions($item->thumb_width, $item->thumb_height, 75) ?>
/>
<? else: ?>
@@ -132,7 +132,7 @@
</div>
</div>
<p><?= gallery::date($comment->created) ?></p>
- <?= nl2br(p::purify($comment->text)) ?>
+ <?= nl2br(SafeString::purify($comment->text)) ?>
</td>
<td>
<ul class="gButtonSetVertical">
diff --git a/modules/comment/views/comment.html.php b/modules/comment/views/comment.html.php
index 3d17411c..31bb7f4d 100644
--- a/modules/comment/views/comment.html.php
+++ b/modules/comment/views/comment.html.php
@@ -4,15 +4,15 @@
<a href="#">
<img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
class="gAvatar"
- alt="<?= p::clean($comment->author_name()) ?>"
+ alt="<?= SafeString::of($comment->author_name()) ?>"
width="40"
height="40" />
</a>
<?= t("on %date_time, %author_name said",
array("date_time" => gallery::date_time($comment->created),
- "author_name" => p::clean($comment->author_name()))) ?>
+ "author_name" => SafeString::of($comment->author_name()))) ?>
</p>
<div>
- <?= nl2br(p::purify($comment->text)) ?>
+ <?= nl2br(SafeString::purify($comment->text)) ?>
</div>
</li>
diff --git a/modules/comment/views/comment.mrss.php b/modules/comment/views/comment.mrss.php
index 2b5b13c1..ae7762d9 100644
--- a/modules/comment/views/comment.mrss.php
+++ b/modules/comment/views/comment.mrss.php
@@ -6,9 +6,9 @@
xmlns:fh="http://purl.org/syndication/history/1.0">
<channel>
<generator>Gallery 3</generator>
- <title><?= p::clean($feed->title) ?></title>
+ <title><?= SafeString::of($feed->title) ?></title>
<link><?= $feed->uri ?></link>
- <description><?= p::clean($feed->description) ?></description>
+ <description><?= SafeString::of($feed->description) ?></description>
<language>en-us</language>
<atom:link rel="self" href="<?= $feed->uri ?>" type="application/rss+xml" />
<fh:complete/>
@@ -22,14 +22,14 @@
<lastBuildDate><?= $pub_date ?></lastBuildDate>
<? foreach ($feed->children as $child): ?>
<item>
- <title><?= p::purify($child->title) ?></title>
- <link><?= p::clean($child->item_uri) ?></link>
- <author><?= p::clean($child->author) ?></author>
+ <title><?= SafeString::purify($child->title) ?></title>
+ <link><?= SafeString::of($child->item_uri) ?></link>
+ <author><?= SafeString::of($child->author) ?></author>
<guid isPermaLink="true"><?= $child->item_uri ?></guid>
<pubDate><?= $child->pub_date ?></pubDate>
<content:encoded>
<![CDATA[
- <p><?= nl2br(p::purify($child->text)) ?></p>
+ <p><?= nl2br(SafeString::purify($child->text)) ?></p>
<p>
<img alt="" src="<?= $child->thumb_url ?>"
height="<?= $child->thumb_height ?>" width="<?= $child->thumb_width ?>" />
diff --git a/modules/comment/views/comments.html.php b/modules/comment/views/comments.html.php
index 6dce9971..9eac0502 100644
--- a/modules/comment/views/comments.html.php
+++ b/modules/comment/views/comments.html.php
@@ -18,16 +18,16 @@
<a href="#">
<img src="<?= $comment->author()->avatar_url(40, $theme->url("images/avatar.jpg", true)) ?>"
class="gAvatar"
- alt="<?= p::clean($comment->author_name()) ?>"
+ alt="<?= SafeString::of($comment->author_name()) ?>"
width="40"
height="40" />
</a>
<?= t('on %date <a href="#">%name</a> 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>
<div>
- <?= nl2br(p::purify($comment->text)) ?>
+ <?= nl2br(SafeString::purify($comment->text)) ?>
</div>
</li>
<? endforeach ?>