Kevin M. Brooks (lucretio) wrote in fotobilder,
Kevin M. Brooks
lucretio
fotobilder

Blank gallery name fix.

Right now you can create a new gallery with no name, by using a space as a name. (It gives you an error, but it still makes the gallery.) You can also rename a gallery to blank.

In /htdocs/manage/gal:
     # rename an existing gallery
-    if ($g && $FORM{'galname'} && $g->{'name'} ne $FORM{'galname'}) {
+    if ($g && $FORM{'galname'} && $g->{'name'} ne $FORM{'galname'} && $FORM{'galname'} =~ /\S/) {
+    # only makes sense if there's at least one non-whitespace character
         $dbu->do("UPDATE gallery SET name=? WHERE userid=? AND gallid=?",
                  undef, $FORM{'galname'}, $u->{'userid'}, $gallid);
         if ($dbu->err) {
             $body .= "";
         } else {
             $body .= "";
             $g->{'name'} = $FORM{'galname'};
             $set_title->();
         }
     }

...
     # create a new gallery
     my $just_created = 0;
-    if (! $g && $FORM{'galname'} ne "") {
+    if (! $g && $FORM{'galname'} =~ /\S/) {
         my $created;
         $g = FB::load_gallery($u, $FORM{'galname'}, { 
             'createsec' => $FORM{'galsec'},
             'created_flag' => \$created,
         });
         unless ($g) {
             $body .= "";
         } else {
             $just_created = 1;
         }
     }

I hope that's right.
Subscribe

  • 302: lj_dev

    In the interests of consolidating all FotoBilder development-related discussion, we're going to be closing down this community. The same…

  • Development stalled?

    Is the development of Fotobilder held? Stalled? I am asking because there is no activity on the community and there is no link to the Fotobilder…

  • (no subject)

    Does FotoBilder works with Apache2? I installed all the required modules on my debian sarge, and when I restart my apache server, it dies horribly…

  • Post a new comment

    Error

    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic
  • 0 comments