CloneSet109


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
32210.999statement_sequence[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
132149
administrator/components/com_media/controllers/file.php
23251
administrator/components/com_media/controllers/folder.php
Clone Instance
1
Line Count
32
Source Line
149
Source File
administrator/components/com_media/controllers/file.php

                if (count($paths)) {
                        foreach ($paths as $path)
                        {
                                if ($path !== JFile::makeSafe($path)) {
                                        JError::raiseWarning(100, JText::_('Unable to delete:')
                                                                  .                             htmlspecialchars($path, ENT_COMPAT, 'UTF-8')
                                                                  .                                                                          ' '
                                                                  .                                                                              JText::_('WARNFILENAME'));
                                        continue;
                                      }
                                $fullPath=  JPath::clean(COM_MEDIA_BASE
                                                         .              DS
                                                         .                 $folder
                                                         .                         DS
                                                         .                            $path);
                                if (is_file($fullPath)) {
                                        $ret |= !JFile::delete($fullPath);
                                      }
                                else   if (is_dir($fullPath)) {
                                        $files=  JFolder::files($fullPath, '.', TRUE);
                                        $canDelete=  TRUE;
                                        foreach ($files as $file) {
                                                if ($file != 'index.html') {
                                                        $canDelete=  FALSE;
                                                      }
                                              }
                                        if ($canDelete) {
                                                $ret |= !JFolder::delete($fullPath);
                                              }
                                        else   {
                                                JError::raiseWarning(100, JText::_('Unable to delete:')
                                                                          .                             $fullPath
                                                                          .                                       ' '
                                                                          .                                           JText::_('Not Empty!'));
                                              }
                                      }
                              }
                      }
                if ($tmpl == 'component') {
                        // We are inside the iframe
                        $mainframe->redirect('index.php?option=com_media&view=mediaList&folder='
                                             .                                                   $folder
                                             .                                                           '&tmpl=component');
                      }
                else   {
                        $mainframe->redirect('index.php?option=com_media&folder='
                                             .                                    $folder);
                      }


Clone Instance
2
Line Count
32
Source Line
51
Source File
administrator/components/com_media/controllers/folder.php

                if (count($paths)) {
                        foreach ($paths as $path)
                        {
                                if ($path !== JFile::makeSafe($path)) {
                                        JError::raiseWarning(100, JText::_('Unable to delete:')
                                                                  .                             htmlspecialchars($path, ENT_COMPAT, 'UTF-8')
                                                                  .                                                                          ' '
                                                                  .                                                                              JText::_('WARNDIRNAME'));
                                        continue;
                                      }
                                $fullPath=  JPath::clean(COM_MEDIA_BASE
                                                         .              DS
                                                         .                 $folder
                                                         .                         DS
                                                         .                            $path);
                                if (is_file($fullPath)) {
                                        $ret |= !JFile::delete($fullPath);
                                      }
                                else   if (is_dir($fullPath)) {
                                        $files=  JFolder::files($fullPath, '.', TRUE);
                                        $canDelete=  TRUE;
                                        foreach ($files as $file) {
                                                if ($file != 'index.html') {
                                                        $canDelete=  FALSE;
                                                      }
                                              }
                                        if ($canDelete) {
                                                $ret |= !JFolder::delete($fullPath);
                                              }
                                        else   {
                                                JError::raiseWarning(100, JText::_('Unable to delete:')
                                                                          .                             $fullPath
                                                                          .                                       ' '
                                                                          .                                           JText::_('Not Empty!'));
                                              }
                                      }
                              }
                      }
                if ($tmpl == 'component') {
                        // We are inside the iframe
                        $mainframe->redirect('index.php?option=com_media&view=mediaList&folder='
                                             .                                                   $folder
                                             .                                                           '&tmpl=component');
                      }
                else   {
                        $mainframe->redirect('index.php?option=com_media&folder='
                                             .                                    $folder);
                      }


Clone AbstractionParameter Count: 1Parameter Bindings

if (count($paths)) {
  foreach ($paths as $path) {
    if ($path !== JFile::makeSafe($path)) {
      JError::raiseWarning(100,JText::_('Unable to delete:')
                               . htmlspecialchars($path,ENT_COMPAT,'UTF-8')
                               . ' '
                               . JText::_( [[#variable588cce00]]));
      continue;
    }
    $fullPath=JPath::clean(COM_MEDIA_BASE
                           . DS
                           . $folder
                           . DS
                           . $path);
    if (is_file($fullPath)) {
      $ret |= !JFile::delete($fullPath);
    }
    else if (is_dir($fullPath)) {
           $files=JFolder::files($fullPath,'.',TRUE);
           $canDelete=TRUE;
           foreach ($files as $file) {
             if ($file != 'index.html') {
               $canDelete=FALSE;
             }
           }
           if ($canDelete) {
             $ret |= !JFolder::delete($fullPath);
           }
           else {
             JError::raiseWarning(100,JText::_('Unable to delete:')
                                      . $fullPath
                                      . ' '
                                      . JText::_('Not Empty!'));
           }
         }
  }
}
if ($tmpl == 'component') {
  // We are inside the iframe
  $mainframe->redirect('index.php?option=com_media&view=mediaList&folder='
                       . $folder
                       . '&tmpl=component');
}
else {
  $mainframe->redirect('index.php?option=com_media&folder='
                       . $folder);
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#588cce00]]
'WARNFILENAME' 
12[[#588cce00]]
'WARNDIRNAME'