public/wordpress/wp-content/plugins/h5p/admin/class-h5p-plugin-admin.php
/**
   * Avoid breaking the upload limit with any of the files
   *
   * @since 1.7.3
   * @param string $dir
   * @return string on error, null if all is OK
   */
Avoid breaking the upload limit with any of the files
@since 1.7.3
@param string $dir
@return string on error, null if all is OK
Avoid breaking the upload limit with any of the files @since 1 . 7 . 3 @param string $dir @return string on error null if all is OK
public static function check_upload_sizes($dir) {
    $files = scandir($dir);
    foreach ($files as $file) {
      $firstChar = substr($file, 0, 1);
      if ($firstChar === '.' || $firstChar === '_') {
        continue; 
      }
      $path = ($dir . '/' . $file);
      if (is_dir($path)) {
        $error = self::check_upload_sizes($path);
        if ($error !== NULL) {
          return $error;
        }
      }
      elseif (is_file($path)) {
        $_POST['html-upload'] = TRUE; 
        $upload = check_upload_size(array('tmp_name' => $path, 'error' => '0'));
        $_POST['html-upload'] = FALSE;
        if ($upload['error'] != '0') {
          return $upload['error'];
        }
      }
    }
    return NULL; 
  }
public static function check_upload_sizes ( $ dir ) { $ files = scandir ( $ dir ) ; foreach ( $ files as $ file ) { $ firstChar = substr ( $ file , 0 , 1 ) ; if ( $ firstChar === '.' || $ firstChar === '_' ) { continue ; } $ path = ( $ dir . '/' . $ file ) ; if ( is_dir ( $ path ) ) { $ error = self :: check_upload_sizes ( $ path ) ; if ( $ error !== NULL ) { return $ error ; } } elseif ( is_file ( $ path ) ) { $ _POST [ 'html-upload' ] = TRUE ; $ upload = check_upload_size ( array ( 'tmp_name' => $ path , 'error' => '0' ) ) ; $ _POST [ 'html-upload' ] = FALSE ; if ( $ upload [ 'error' ] != '0' ) { return $ upload [ 'error' ] ; } } } return NULL ; }
Avoid breaking the upload limit with any of the files
 @since 1.7.3
 @param string $dir
 @return string on error, null if all is OK
Avoid breaking the upload limit with any of the files @since 1 . 7 . 3 @param string $dir @return string on error null if all is OK
// Skip hidden files (will not be save by core) // Scan dir // Check file size // Small hack to get output instead of wp_die(). // All OK