Changes for page Macros for the Blog application
on 2026/12/02 00:14
Summary
Details
- Page properties
-
- Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. superadmin1 +xwiki:XWiki.haleden - Content
-
... ... @@ -102,7 +102,12 @@ 102 102 * @param title The resulting title. 103 103 *### 104 104 #macro(getBlogTitle $blogDoc $title) 105 - #getBlogProperty($blogDoc 'title' $!blogDoc.displayTitle $title) 105 + ## The blog title is the rendered document title. It is displayed as data (never evaluated as 106 + ## Velocity), so an unprivileged user storing script in Blog.BlogClass.title cannot run it. See 107 + ## Blog.BlogSheet, which renders the title literally and falls back to the blog.code.title 108 + ## translation when the stored title is empty. 109 + #set ($title = $NULL) 110 + #setVariable ("$title" $!blogDoc.displayTitle) 106 106 #end 107 107 ## 108 108 ## ... ... @@ -115,7 +115,9 @@ 115 115 * @param description The resulting description. 116 116 *### 117 117 #macro(getBlogDescription $blogDoc $description) 118 - #getBlogProperty($blogDoc 'description' '' $description) 123 + #getBlogProperty($blogDoc 'description' '' $result) 124 + #set ($description = $NULL) 125 + #setVariable ("$description" $result) 119 119 #end 120 120 ## 121 121 ## ... ... @@ -341,7 +341,9 @@ 341 341 * @param displayType The resulting string. If the blog object does not define anything, it is considered paginated. 342 342 *### 343 343 #macro(getBlogDisplayType $blogDoc $displayType) 344 - #getBlogProperty($blogDoc 'displayType' 'paginated' $displayType) 351 + #getBlogProperty($blogDoc 'displayType' 'paginated' $result) 352 + #set ($displayType = $NULL) 353 + #setVariable ("$displayType" $result) 345 345 #end 346 346 ## 347 347 ## ... ... @@ -836,10 +836,12 @@ 836 836 * @param propertyValue The resulting value. 837 837 *### 838 838 #macro(getBlogProperty $blogDoc $propertyName $defaultValue $propertyValue) 839 - #set($ propertyValue= "$!{blogDoc.getObject(${blogClassname}).getProperty($propertyName).value}")840 - #if($ propertyValue== '')841 - #set($ propertyValue= $defaultValue)848 + #set($result = "$!{blogDoc.getObject(${blogClassname}).getProperty($propertyName).value}") 849 + #if($result == '') 850 + #set($result = $defaultValue) 842 842 #end 852 + #set ($propertyValue = $NULL) 853 + #setVariable ("$propertyValue" $result) 843 843 #end 844 844 845 845 ## Compatibility helpers from the installed Blog 9.15.15 package.