Compare commits

..

No commits in common. "74e998add4314a5d18c0b3e437e4c313cf955539" and "aff19de2eac061a2bf13035b3f65cfa29ae1d3ff" have entirely different histories.

5 changed files with 11 additions and 65 deletions

View file

@ -383,70 +383,34 @@ class Post extends Postable
{
$domain = ovk_scheme(true).$_SERVER["HTTP_HOST"];
$description = $this->getText(false);
$title = str_replace("\n", "", ovk_proc_strtr($description, 79));
$description_html = $description;
$url = $domain."/wall".$this->getPrettyId();
if($this->isUpdateAvatarMessage())
$title = tr('upd_in_general');
if($this->isDeactivationMessage())
$title = tr('post_deact_in_general');
$author = $this->getOwner();
$target_wall = $this->getWallOwner();
$author_name = escape_html($author->getCanonicalName());
$author_name = htmlspecialchars($author->getCanonicalName(), ENT_DISALLOWED | ENT_XHTML);
if($this->isExplicit())
$title = 'NSFW: ' . $title;
$description_html .= "<br /><b>".tr('contains_nsfw').".</b><br />";
foreach($this->getChildren() as $child) {
if($child instanceof Photo) {
$child_page = $domain.$child->getPageURL();
$child_url = $child->getURL();
$description_html .= "<br /><a href='$child_page'><img src='$child_url'></a><br />";
$child_url = $child->getURLBySizeId('large');
$description_html .= "<br /><a href='$child_page'><img src='$child_url'></a>";
} elseif($child instanceof Video) {
$child_page = $domain.'/video'.$child->getPrettyId();
if($child->getType() != 1) {
$description_html .= "".
"<br />".
"<video width=\"320\" height=\"240\" controls><source src=\"".$child->getURL()."\" type=\"video/mp4\"></video><br />".
"<b>".escape_html($child->getName())."</b><br />";
} else {
$description_html .= "".
"<br />".
"<a href=\"".$child->getVideoDriver()->getURL()."\"><b>".escape_html($child->getName())."</b></a><br />";
}
$description_html .= "<br /><a href='$child_page'>Video</a>";
} elseif($child instanceof Audio) {
if(!$child->isWithdrawn()) {
$description_html .= "<br />"
."<b>".escape_html($child->getName())."</b>:"
."<br />"
."<audio controls>"
."<source src=\"".$child->getOriginalURL()."\" type=\"audio/mpeg\"></audio>"
."<br />";
}
} elseif($child instanceof Poll) {
$description_html .= "<br />".tr('poll').": ".escape_html($child->getTitle());
} elseif($child instanceof Note) {
$description_html .= "<br />".tr('note').": ".escape_html($child->getName());
$description_html .= "<br />Audio";
}
}
$description_html .= "<br />".tr('author').": <img width='15px' src='".$author->getAvatarURL()."'><a href='".$author->getURL()."'>" . $author_name . "</a>";
if($target_wall->getRealId() != $author->getRealId())
$description_html .= "<br />".tr('on_wall').": <img width='15px' src='".$target_wall->getAvatarURL()."'><a href='".$target_wall->getURL()."'>" . escape_html($target_wall->getCanonicalName()) . "</a>";
if($this->isSigned()) {
$signer = $this->getOwner(false);
$description_html .= "<br />".tr('sign_short').": <img width='15px' src='".$signer->getAvatarURL()."'><a href='".$signer->getURL()."'>" . escape_html($signer->getCanonicalName()) . "</a>";
if($this->hasSource()) {
$description_html .= "<br />".tr('source').": ".htmlspecialchars($this->getSource(), ENT_DISALLOWED | ENT_XHTML);
}
if($this->hasSource())
$description_html .= "<br />".tr('source').": ".escape_html($this->getSource());
$item = new \Bhaktaraz\RSSGenerator\Item();
$item->title($title)
$item->title(str_replace("\n", "", ovk_proc_strtr($description, 79)))
->url($url)
->guid($url)
->creator($author_name)

View file

@ -53,9 +53,9 @@ class Posts
$offset--;
}
}
} else if(!is_null($offset) && $pinPost) {
} /*else if(!is_null($offset)) {
$offset--;
}
}*/
$sel = $this->posts->where([
"wall" => $user,

View file

@ -366,11 +366,6 @@ function check_copyright_link(string $link = ''): bool
return true;
}
function escape_html(string $unsafe): string
{
return htmlspecialchars($unsafe, ENT_DISALLOWED | ENT_XHTML);
}
return (function() {
_ovk_check_environment();
require __DIR__ . "/vendor/autoload.php";

View file

@ -2236,10 +2236,3 @@
"roll_back" = "rollback";
"roll_backed" = "rollbacked";
/* RSS */
"post_deact_in_general" = "Page deletion";
"upd_in_general" = "Avatar update";
"on_wall" = "On wall";
"sign_short" = "Sign";

View file

@ -2127,9 +2127,3 @@
"roll_back" = "откатить";
"roll_backed" = "откачено";
/* RSS */
"post_deact_in_general" = "Удаление страницы";
"upd_in_general" = "Обновление фотографии страницы";
"on_wall" = "На стене";
"sign_short" = "Подпись";