Welcome to Geeklog, Anonymous Friday, November 29 2024 @ 10:33 pm EST
Geeklog Forums
How do I put an apostrophe in a Block Title?
Anonymous
Anonymous
I've noticed that this site has a number of blocks with apostrophes in their title e.g. What's New.
If I attempt to do this, geeklog inserts a backslash before the apostrophe (and it gets displayed in the block title).
What's the secret for achieving what you've done?
14
9
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Yeah, this is a bug in admin/block.php (actually, that one's fixed in 1.3.5sr2). You need to add
$title = addslashes ($title);
before line 347 in block.php so that it reads
// Convert array values to numeric permission values
list($perm_owner,$perm_group,$perm_members,$perm_anon) = SEC_getPermissionValues($perm_owner,$perm_group,$perm_members,$perm_anon);
$title = addslashes ($title);
DB_save(...
bye, Dirk
8
8
Quote
Anonymous
Anonymous
I am using 1.3.5sr2.
If addslashes is used prior to putting $title into the database then it looks like stripslashes isn't being called after removing it from the database prior to display.
7
11
Quote
Anonymous
Anonymous
I believe the following patch, for 1.3.5sr2, is what's required but I'd appreciate your comments.
--- public_html/admin/block.php.orig Wed Jul 10 10:09:54 2002
+++ public_html/admin/block.php Wed Jul 10 13:28:29 2002
@@ -77,7 +77,7 @@
$block_templates->set_var('layout_url', $_CONF['layout_url']);
$block_templates->set_var('block_id', $A['bid']);
$block_templates->set_var('lang_blocktitle', $LANG21[5]);
- $block_templates->set_var('block_title', $A['title']);
+ $block_templates->set_var('block_title', stripslashes($A['title']));
$block_templates->set_var('lang_enabled', $LANG21[53]);
if ($A['is_enabled'] == 1) {
$block_templates->set_var('is_enabled', 'checked="CHECKED"');
@@ -177,7 +177,7 @@
$block_templates->set_var('block_bid', $A['bid']);
$block_templates->set_var('lang_blocktitle', $LANG21[5]);
- $block_templates->set_var('block_title', $A['title']);
+ $block_templates->set_var('block_title', stripslashes($A['title']));
$block_templates->set_var('lang_enabled', $LANG21[53]);
if ($A['is_enabled'] == 1) {
$block_templates->set_var('is_enabled', 'checked="CHECKED"');
@@ -409,7 +409,7 @@
$A = DB_fetchArray($result);
$block_templates->set_var('block_id', $A['bid']);
- $block_templates->set_var('block_title', $A['title']);
+ $block_templates->set_var('block_title', stripslashes($A['title']));
$access = SEC_hasAccess($A['owner_id'],$A['group_id'],$A['perm_owner'],$A['perm_group'],$A['perm_members'],$A['perm_anon']);
if ($access > 0) {
--- public_html/lib-common.php.orig Wed Jul 10 10:16:38 2002
+++ public_html/lib-common.php Wed Jul 10 13:13:23 2002
@@ -496,7 +496,7 @@
$block->set_file('block', $template);
$block->set_var('site_url',$_CONF['site_url']); // not used but some custom theme may want it
$block->set_var('layout_url', $_CONF['layout_url']);
- $block->set_var('block_title',$title);
+ $block->set_var('block_title', stripslashes($title));
if (!empty($helpfile)) {
if (!stristr($helpfile,'http://')) {
$help = '<a class="blocktitle" href="' . $_CONF['site_url'] . '/help/' . $helpfile
10
10
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Ah, okay. It is quite possible that the addslashes() in block.php coincides with a stripslashes() somewhere else that did not make it into 1.3.5sr2 :-/
It works in 1.3.6 (i.e. the version from CVS), though ...
Hmm, try if removing the addslashes() line I mentioned above will help.
bye, Dirk
8
13
Quote
Anonymous
Anonymous
I posted a patch to the SourceForge Patch Tracker on this. You might want to see if what I did ties in with the 1.3.6 code.
Regards,
Neil Darlow M.Sc.
7
13
Quote
Status: offline
Creator
Forum User
Full Member
Registered: 07/11/02
Posts: 181
Location:Austin, TX
I've tried this, and also the suggestion posted by Dirk. Nothing works. Using GL 1.3.5sr2.
This problem doesn't occur in just the block titles, it occurs EVERYWHERE I use an apostrophe.
L. Whitworth
L. Whitworth
13
11
Quote
ScottN
Anonymous
I was able to solve the problem without hacking the source code by using the html escape code for an apostrophe in the block title. Instead of "What's New" (which the bug turned into "What\\'s New" in the Block Title field, I entered...
What's New
Works like a charm, as far as I can tell, but you have to re-enter the escape code every time you edit a block with an apostrophe in the title. I'm curious if my workaround would work for non-IE browsers and in all countries. The escape code ("'" is the ISO 8859-1 (Latin-1) html escape code for an apostrophe, but Geeklog doesn't specify the character set in the html <head> output. If it did, it would look like this:
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
So I'm assuming it works in my browser because ISO 8859-1 is the default character set?
7
9
Quote
Status: offline
Dirk
Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Please try this out with Geeklog 1.3.6rc1 - it should work there. Btw, Geeklog now also supports setting a character set (although I don't think it ever had anything to do with this problem ...).
bye, Dirk
13
15
Quote
All times are EST. The time is now 10:33 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content