Closed (fixed)
Project:
CCK Blocks
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
18 Mar 2010 at 14:07 UTC
Updated:
1 Apr 2010 at 19:50 UTC
Jump to comment: Most recent
Field label is required when creating field so no need to check existence and use $field_name or $delta in block subject and admin title of the block
Also some code clean-up, query for block title should use placeholder %s
| Comment | File | Size | Author |
|---|---|---|---|
| cck_blocks-translate.patch | 2.63 KB | andypost |
Comments
Comment #1
Anonymous (not verified) commentedThank you for antother useful patch. I agree, that field labels are mandatory, so we don't need to check them for existence.
Could you explain, why you're still checking that?
Just seems to be a different notation of my code without replacing them by the field's name, if the label doesn't exist.
I removed your if-statement and it seems to work.
Comment #2
andypostHm, I think it's useless
I leave this for case if some contrib module could alter widget settings and make label empty so using isset() is wrong - should be !empty()
Comment #3
andypostAlso this patch closes a security hole! Direct user input printed without filtering!
Comment #4
Anonymous (not verified) commentedThank's for that comment. Is it possible, that other modules set the label to "NULL"? We have to assign a subject for the block. If that isn't possible, I'd recommend only to do
$block['subject'] = t($fields[$delta]['widget']['label']);or leave it like I did it before, as it assigns the name of the field if there is no label.Your security fix will be commited anyway!
Comment #5
andypostI think it's a bad idea to output $fieldname as block title so let's proceed with
$block['subject'] = t($fields[$delta]['widget']['label']);Comment #6
Anonymous (not verified) commentedFixed in next -dev