Recent Topics

Bug+Patch rss & Atom redirect are limited to 50 characte

Started by on Apr 22, 2009 – Contents updated: Apr 22, 2009

Apr 22, 2009 11:59    

In 2.4.6 but also in 3.x the fields rss2_redirect and atom_redirect inside the advanced blog settings are limited needlessly to 50 characters. I realized that when trying to input my brand new feedburner URL:

http://feed.liberal-venezolano.net/ElLiberalVenezolano

Which has 54 characters :)

The culprit is in inc/collections/views/_coll_advanced.form.php around line 86, which passes a field size of 50 to $Form->textinput and this in turn uses the field size as default maxlength for the field.

Inspecting the database, the cset_value column of evo_coll_settings has a maximum length of 255 chars, so the 50 chars limitation here is not needed.

Here is a patch against 2.4.6 sources:

PHP

--- evodev/inc/collections/views/_coll_advanced.form.php    2009-04-22 11:40:36.000000000 +0200
+++ blog/inc/collections/views/_coll_advanced.form.php    2009-01-25 19:15:40.000000000 +0100
@@ -85,+85,@@
 
 $Form->begin_fieldsetT_('External Feeds').get_manual_link('external_feeds') );
     $Form->text_input'atom_redirect'$edited_Blog->get_setting'atom_redirect' ), 50T_('Atom Feed URL'),
-                                            T_('Example: Your Feedburner Atom URL'), array('maxlength' => 255));
+                                            T_('Example: Your Feedburner Atom URL'));
     $Form->text_input'rss2_redirect'$edited_Blog->get_setting'rss2_redirect' ), 50T_('RSS2 Feed URL'),
-                                            T_('Example: Your Feedburner RSS2 URL'), array('maxlength' => 255) );
+                                            T_('Example: Your Feedburner RSS2 URL'));
 $Form->end_fieldset();

If the patch is reversed, I'm sorry, I always forget which one goes first :( In any case you can see the fix is trivial.

EDIT: Oh my, when will I learn! The correct patch (not reversed) is this:

PHP

--- blog/inc/collections/views/_coll_advanced.form.php    2009-01-25 19:15:40.000000000 +0100
+++ evodev/inc/collections/views/_coll_advanced.form.php    2009-04-22 11:40:36.000000000 +0200
@@ -85,+85,@@
 
 $Form->begin_fieldsetT_('External Feeds').get_manual_link('external_feeds') );
     $Form->text_input'atom_redirect'$edited_Blog->get_setting'atom_redirect' ), 50T_('Atom Feed URL'),
-                                            T_('Example: Your Feedburner Atom URL'));
+                                            T_('Example: Your Feedburner Atom URL'), array('maxlength' => 255));
     $Form->text_input'rss2_redirect'$edited_Blog->get_setting'rss2_redirect' ), 50T_('RSS2 Feed URL'),
-                                            T_('Example: Your Feedburner RSS2 URL'));
+                                            T_('Example: Your Feedburner RSS2 URL'), array('maxlength' => 255) );
 $Form->end_fieldset();

May 05, 2009 16:02

I've applied it to the trunk some days ago.


Form is loading...

powered by b2evolution free blog software – This forum is powered by b2evolution CMS, a complete engine for your website.