Navigation Menu

Skip to content

Commit

Permalink
added token to support the preview link in backend entries
Browse files Browse the repository at this point in the history
  • Loading branch information
ophian committed Jan 16, 2012
1 parent 068837d commit 4822b3e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
22 changes: 12 additions & 10 deletions docs/NEWS
Expand Up @@ -4,17 +4,19 @@
Version 1.7 ()
------------------------------------------------------------------------

* Allow Smarty to fetch .tpl files from all directories so that
s9y plugin can use the fetch() call for their .tpl files no
matter which (symlinked) directory the plugin resides in.
The Smarty security policy to us only serves as a restriction
within .tpl files to not allow arbitrary PHP modifier/function calls.
If in the future Smarty supports enforcing trustedDir checks on
{include} calls seperately to smarty->fetch() calls, we'll also
add that to .tpl files.
(garvinhicking)
* fixed draft & future entries preview link in backend

* Allow Smarty to fetch .tpl files from all directories so that
s9y plugin can use the fetch() call for their .tpl files no
matter which (symlinked) directory the plugin resides in.
The Smarty security policy to us only serves as a restriction
within .tpl files to not allow arbitrary PHP modifier/function calls.
If in the future Smarty supports enforcing trustedDir checks on
{include} calls seperately to smarty->fetch() calls, we'll also
add that to .tpl files.
(garvinhicking)

* Patch by Markus Brükner: Properly handle files that have no
* Patch by Markus Brükner: Properly handle files that have no
extension in media database

* Made Spartacus recognize github.com mirror (garvinhicking)
Expand Down
2 changes: 1 addition & 1 deletion include/admin/entries.inc.php
Expand Up @@ -284,7 +284,7 @@ function invertSelection() {
</td>
<td align="right">
<?php if (serendipity_db_bool($entry['isdraft']) || (!$serendipity['showFutureEntries'] && $entry['timestamp'] >= serendipity_serverOffsetHour())) { ?>
<a target="_blank" href="<?php echo $entry['preview_link']; ?>" title="<?php echo PREVIEW . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo PREVIEW; ?>" /><?php echo PREVIEW ?></a>
<a target="_blank" href="<?php echo $entry['preview_link']; ?>&amp;<?php echo serendipity_setFormToken('url'); ?>" title="<?php echo PREVIEW . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo PREVIEW; ?>" /><?php echo PREVIEW ?></a>
<?php } else { ?>
<a target="_blank" href="<?php echo $entry['link']; ?>" title="<?php echo VIEW . ' #' . $entry['id']; ?>" class="serendipityIconLink"><img src="<?php echo serendipity_getTemplateFile('admin/img/zoom.png'); ?>" alt="<?php echo VIEW; ?>" /><?php echo VIEW ?></a>
<?php } ?>
Expand Down

1 comment on commit 4822b3e

@ophian
Copy link
Member Author

@ophian ophian commented on 4822b3e Jan 16, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found S9y 1.7 (trunk) does not need more to allow draft and future entries preview in the entries overview panel.
If it might be worth adding the checkPerm...

        if ( !serendipity_checkFormToken() || !serendipity_checkPermission('adminEntries') ) {
            return false;
        }

to the function serendipity_iframe_create() is another question.

Please help testing.

With current 1.6 version or the 1.6.1 branch, I am not sure, as it is working the same, but I found some missing nl2br-plugin parsing and/or magically set scrolling="no" to the 300px height iframe, which is bad with entries needing more vertical space. It would really be nice to have this tested outside my very own enviroment, as I keep getting differing results and do not absolutly know why. (See german thread http://board.s9y.org/viewtopic.php?f=10&t=17201)

Please sign in to comment.