original_string: public static function validatePath($filePath, $maxNesting = 2)
      {
          if (strpos($filePath, '..') !== false) {
              return false;
          }
  
          if (strpos($filePath, './') !== false || strpos($filePath, '//') !== false) {
              return false;
          }
  
          $segments = explode('/', $filePath);
          if ($maxNesting !== null && count($segments) > $maxNesting) {
              return false;
          }
  
          foreach ($segments as $segment) {
              if (!self::validateName($segment)) {
                  return false;
              }
          }
  
          return true;
      }
code: public static function validatePath($filePath, $maxNesting = 2)
      {
          if (strpos($filePath, '..') !== false) {
              return false;
          }
  
          if (strpos($filePath, './') !== false || strpos($filePath, '//') !== false) {
              return false;
          }
  
          $segments = explode('/', $filePath);
          if ($maxNesting !== null && count($segments) > $maxNesting) {
              return false;
          }
  
          foreach ($segments as $segment) {
              if (!self::validateName($segment)) {
                  return false;
              }
          }
  
          return true;
      }
code_tokens: public static function validatePath ( $ filePath , $ maxNesting = 2 ) { if ( strpos ( $ filePath , '..' ) !== false ) { return false ; } if ( strpos ( $ filePath , './' ) !== false || strpos ( $ filePath , '//' ) !== false ) { return false ; } $ segments = explode ( '/' , $ filePath ) ; if ( $ maxNesting !== null && count ( $ segments ) > $ maxNesting ) { return false ; } foreach ( $ segments as $ segment ) { if ( ! self :: validateName ( $ segment ) ) { return false ; } } return true ; }
docstring: Validates a CMS object path.
  CMS object directory and file names can contain only alphanumeric symbols, dashes and dots.
  CMS objects support only a single level of subdirectories.
  @param string $filePath Specifies a path to validate
  @param integer $maxNesting Specifies the maximum allowed nesting level
  @return boolean Returns true if the file name is valid. Otherwise returns false.
docstring_tokens: Validates a CMS object path . CMS object directory and file names can contain only alphanumeric symbols dashes and dots . CMS objects support only a single level of subdirectories .