public
Description: Git mirror of the CMS Made Simple 2.0 rewrite
Homepage: http://cmsmadesimple.org
Clone URL: git://github.com/tedkulp/cmsmadesimple-2-0.git
Changed metadata tag so that it only compiles it when it finds smarty 
delimiters
Changed modified_date tag so that it runs the output through htmlentities 
first


git-svn-id: http://svn.cmsmadesimple.org/svn/cmsmadesimple/trunk@2729 
3d254a34-79dc-0310-9e5f-be208747d8a0
tedkulp (author)
Thu Apr 27 03:00:49 -0700 2006
commit  ebfe9a70a52e1165dfbcf9f62d6827aa24bd76a9
tree    97e9e01eb130c074820472b9aa1604f6481ac7a4
parent  68d1894f51c7a1a7076964a4de132f736557b3fd
...
23
24
25
 
26
27
28
...
31
32
33
34
35
36
37
38
39
 
 
 
 
 
 
 
 
40
41
 
 
42
43
44
...
23
24
25
26
27
28
29
...
32
33
34
 
 
 
 
 
 
35
36
37
38
39
40
41
42
43
 
44
45
46
47
48
0
@@ -23,6 +23,7 @@ function smarty_cms_function_metadata($params, &$smarty)
0
   global $gCms;
0
   $config =& $gCms->GetConfig();
0
   $pageinfo =& $gCms->variables['pageinfo'];
0
+
0
   if (isset($pageinfo) && $pageinfo !== FALSE)
0
   {
0
     if ($pageinfo->content_metadata != '')
0
@@ -31,14 +32,17 @@ function smarty_cms_function_metadata($params, &$smarty)
0
     }
0
   }
0
 
0
- $smarty->_compile_source('metadata template', $result, $_compiled);
0
- @ob_start();
0
- $smarty->_eval('?>' . $_compiled);
0
- $_contents = @ob_get_contents();
0
- @ob_end_clean();
0
- $_contents .= "\n<base href=\"".$config['root_url']."/\" />\n";
0
+ if ((!strpos($result,$smarty->left_delimiter) === false) and (!strpos($result,$smarty->right_delimiter) === false))
0
+ {
0
+ $smarty->_compile_source('metadata template', $result, $_compiled);
0
+ @ob_start();
0
+ $smarty->_eval('?>' . $_compiled);
0
+ $result = @ob_get_contents();
0
+ @ob_end_clean();
0
+ }
0
 
0
- return $_contents;
0
+ $result .= "\n<base href=\"".$config['root_url']."/\" />\n";
0
+ return $result;
0
 }
0
 
0
 function smarty_cms_help_function_metadata() {
...
32
33
34
35
 
36
37
38
...
32
33
34
 
35
36
37
38
0
@@ -32,7 +32,7 @@ function smarty_cms_function_modified_date($params, &$smarty)
0
 
0
   if (isset($pageinfo) && $pageinfo->content_modified_date > -1)
0
   {
0
- return strftime($format, $pageinfo->content_modified_date);
0
+ return htmlentities(strftime($format, $pageinfo->content_modified_date));
0
   }
0
   else
0
   {

Comments

    No one has commented yet.