Uploaded image for project: 'CMS CONTENIDO'
  1. CMS CONTENIDO
  2. CON-1646

PHP Warning open_basedir in cModuleHandler

    Details

      Description

      The logic to read all files

      cModuleHandler.getAllFilesFromDirectory()

      within a module directory may cause a PHP warning, if PHP is configured with a restrictive open_basedir setting.

      The related entry in the errolog.txt is like:

      [...] PHP Warning:  is_dir() [<a href='function.is-dir'>function.is-dir</a>]: open_basedir restriction in effect. File(.../cms/data/modules/form_login/template/login.tpl/) is not within the allowed path(s): (/path/to/contenido/:/another/path) in .../contenido/classes/module/class.module.handler.php on line 556
      

      We should not do a check like

      is_dir($dir . $file . '/')
      

      since this concatenates a wrong path string in case of an file...

      It is better to use DirectoryIterator with DirectoryIterator.isFile() or DirectoryIterator.isDir()

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                claus.schunk claus.schunk
                Reporter:
                xmurrix Murat Purc
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: