[TYPO3-dam-devel] RFC Bugfix: 6630: xclass ux_t3lib_extFileFunctions->func_upload has wrong default parameters

Andreas Balzer andreasbalzer at gmail.com
Wed Dec 26 22:45:03 CET 2007


adding my +1 ;)

On Dec 26, 2007 10:18 PM, Michiel Roos <michiel at netcreators.com> wrote:

> Andreas Balzer wrote:
> > +1
> > although I don't know whether this patch might get in conflict with an
> > other feature of dam. Is it possible to find these things out?
> >
> Ok, first the function read:
>
>  function func_upload($cmds, $id)  {
>    if (!$this->isInit) return FALSE;
>    if (!$_FILES['upload_'.$id]['name'])  {
>      return;
>    }
>
>
> With the proposed patch it reads:
>
>  function func_upload($cmds, $id=false)  {
>    if ($id===false) $id=$cmds['data'];
>    if (!$this->isInit) return FALSE;
>    if (!$_FILES['upload_'.$id]['name'])  {
>      return;
>    }
>
>
> Furthermore the comment reads:
>   * @param array   $cmds['data'] is the ID-number (points to the global
> var that holds the filename-ref
> ($GLOBALS['HTTP_POST_FILES']['upload_'.$id]['name']). $cmds['target'] is
> the target directory
>   * @param string    $id: $_FILES['upload_'.$id]
>
> So the $cmds['data'] does hold the needed id to lookup the name in:
> $GLOBALS['HTTP_POST_FILES']['upload_'.$id]['name']
> or shorter: $_FILES['upload_'.$id]['name']
>
> I wonder why the parameter was added in the first place, maybe to
> override an id if neede. This still works. If no id is given it behaves
> as it should. So extensions like rs_userimp behave as expected.
>
> I don't think I am overlooking something. Anyone?
>
> So still a +1 from me.
>
> Kind regards,
>
>
> Michiel Roos
>
> --
> Netcreators BV :: creation and innovation
> www.netcreators.com
>
> Interesse in werken bij Netcreators?
> http://www.netcreators.com/bedrijf/vacatures/
>
>
> _______________________________________________
> TYPO3-team-dam mailing list
> TYPO3-team-dam at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-team-dam
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.netfielders.de/pipermail/typo3-team-dam/attachments/20071226/0cf73b40/attachment.htm 


More information about the TYPO3-team-dam mailing list