WeBid Bug Tracking

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000439WeBidAuctionspublic2013-06-23 19:072016-03-23 14:58
Reporterlinux4me 
Assigned Torenlok 
PriorityurgentSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version1.1.0 
Target VersionFixed in Version1.2.0 
Summary0000439: Unknown error type: [2] opendir(/home/<username>/public_html/uploaded//1) [function.opendir]: failed to open dir: No such
DescriptionTo reproduce this error, a user must attempt to delete or close an auction that doesn't have any images. I know that's not going to happen often, but it's still a nice error to trap so administrative users don't have to worry about what it means when the error pops up in the Error Log.



The fix is to add a check for a viable directory. On line 38 of yourauctions_p.php find:

if ($dir = @opendir($upload_path . '/' . $v))

                {

                    while ($file = readdir($dir))

                    {

                        if ($file != '.' && $file != '..')

                        {

                            @unlink($upload_path . '/' . $v . $file);

                        }

                    }

                    closedir($dir);

                    @rmdir($upload_path . '/' . $v);

                }


and change it to this:

if (is_dir($upload_path . '/' . $v)) {

                if ($dir = @opendir($upload_path . '/' . $v))

                {

                    while ($file = readdir($dir))

                    {

                        if ($file != '.' && $file != '..')

                        {

                            @unlink($upload_path . '/' . $v . $file);

                        }

                    }

                    closedir($dir);

                    @rmdir($upload_path . '/' . $v);

                }

            }
TagsNo tags attached.
import_id441
Thread
Attached Files

- Relationships

-  Notes
(0001110)
linux4me (reporter)
2013-06-27 20:20
edited on: 1970-01-01 00:00

A similar error occurs on yourauctions.php when deleting an active auction with no images. A similar fix works there, too, but the path is differently coded. On line 37 of yourauctions.php find this:
if ($dir = @opendir($upload_path . $v))
            {
                while ($file = readdir($dir))
                {
                    if ($file != '.' && $file != '..')
                    {
                        @unlink($upload_path . $v . '/' . $file);
                    }
                }
                closedir($dir);
                @rmdir($upload_path . $v);
            }

and replace it with this:
if (is_dir($upload_path . $v)) {
                if ($dir = @opendir($upload_path . $v))
                {
                    while ($file = readdir($dir))
                    {
                        if ($file != '.' && $file != '..')
                        {
                            @unlink($upload_path . $v . '/' . $file);
                        }
                    }
                    closedir($dir);
                    @rmdir($upload_path . $v);
                }
            }

I haven't had a chance to test it yet, but I suspect the same issue may be present in other yourauctions files that allow deletions.
(0001146)
pani100 (reporter)
2013-08-20 09:25
edited on: 1970-01-01 00:00

There is something going wrong with that part of the script.
yourauctions_p.php and yourauctions_s.php: @unlink($upload_path . '/' . $v . $file);
yourauctions.php and yourauctions_c.php: @unlink($upload_path . $v . '/' . $file);
The link keeps changing so there will be errors.
I think they all should be @unlink($upload_path . $v . '/' . $file); as $uploaded_path = 'uploaded/'; and it would guide it to the correct location of 'uploaded/Auction_id/image'
(0001151)
nay27uk (reporter)
2013-09-01 14:28
edited on: 1970-01-01 00:00

Thanks for this I have not yet come across this problem but it is added to my faves for future reference

- Issue History
Date Modified Username Field Change
2015-04-01 13:17 renlok New Issue
2015-04-01 13:17 renlok import_id => 441
2015-04-01 13:17 renlok Date Submitted 2015-04-01 13:17 => 2013-06-23 19:07
2015-04-01 13:17 renlok Last Update 2015-04-01 13:17 => 2013-09-01 14:28
2016-03-23 14:58 renlok Status new => resolved
2016-03-23 14:58 renlok Fixed in Version => 1.2.0
2016-03-23 14:58 renlok Resolution open => fixed
2016-03-23 14:58 renlok Assigned To => renlok


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker