@@ -19,19 +19,26 @@ $description = Common::stripUpTo(trim(filter_var(
1919 FILTER_SANITIZE_STRING
2020)), "\n" , 300 );
2121
22- $ this ->opengraph ->attach (new Pair ("url " , "/news/ " . urlencode ($ object_id )));
2322$ this ->opengraph ->attach (new Pair ("type " , "article " ));
23+
24+ $ url = Common::relativeUrlToAbsolute ("/news/ " . urlencode ($ object_id ));
25+
2426if ($ object ) {
27+
28+ $ url = $ object ->getURI ();
29+
2530 $ this ->opengraph ->attach (new Pair ("image " , "/a/news_categories/ " . $ object ->getCategory ()->getFilename ()));
2631 $ this ->opengraph ->attach (new Pair ("article:published_time " , $ object ->getCreatedDateTime ()->format ("c " )));
2732 if (!is_null ($ object ->getEditedDateTime ())) {
2833 $ this ->opengraph ->attach (new Pair ("article:modified_time " , $ object ->getEditedDateTime ()->format ("c " )));
2934 }
3035 $ this ->opengraph ->attach (new Pair ("article:author:username " , $ object ->getUser ()->getName ()));
3136 $ this ->opengraph ->attach (new Pair ("article:section " , $ object ->getCategory ()->getLabel ()));
37+
3238}
3339
34- $ url = Common::relativeUrlToAbsolute ("/news/ " . urlencode ($ object_id ));
40+ $ this ->opengraph ->attach (new Pair ("url " , $ url ));
41+
3542$ edit_url = Common::relativeUrlToAbsolute ("/news/edit?id= " . urlencode ($ object_id ));
3643$ delete_url = Common::relativeUrlToAbsolute ("/news/delete?id= " . urlencode ($ object_id ));
3744$ edit_visible = ($ logged_in && ($ logged_in ->getOptionsBitmask ()
@@ -40,7 +47,6 @@ $delete_visible = ($logged_in && ($logged_in->getOptionsBitmask()
4047 & User::OPTION_ACL_NEWS_DELETE ));
4148
4249if ($ object ) {
43- $ url .= "/ " . Common::sanitizeForUrl ($ object ->getTitle (), true );
4450 $ user_name = $ object ->getUser ()->getName ();
4551 $ user_id = $ object ->getUserId ();
4652 $ user_url = $ object ->getUser ()->getURI ();
0 commit comments