Exploit databaseDownload repository ZIP
GH-8c7f0e4b0e998904a1d6f7dcd99e3e7d
d-xuan/cve-2024-52510
Sources for CVE-2024-52510
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files19
d-xuan/cve-2024-52510Revision 6c0d89756ae0
- ↑..Parent directory
- CallbackWrapper.php
- CountWrapper.php
- Directory.php
- DirectoryFilter.php
- DirectoryWrapper.php
- File.php
- HashWrapper.php
- IteratorDirectory.php
- NullWrapper.php
- Path.php
- PathWrapper.php
- ReadHashWrapper.php
- RetryWrapper.php
- SeekableWrapper.php
- Url.php
- UrlCallback.php
- Wrapper.php
- WrapperHandler.php
- WriteHashWrapper.php
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
apps/files_external/3rdparty/icewind/streams/src/IteratorDirectory.php
PHP · 2,345 bytes<?php
/**
* SPDX-FileCopyrightText: 2014 Robin Appelman <[email protected]>
* SPDX-License-Identifier: MIT
*/
namespace Icewind\Streams;
/**
* Create a directory handle from an iterator or array
*
* The following options should be passed in the context when opening the stream
* [
* 'dir' => [
* 'array' => string[]
* 'iterator' => \Iterator
* ]
* ]
*
* Either 'array' or 'iterator' need to be set, if both are set, 'iterator' takes preference
*/
class IteratorDirectory extends WrapperHandler implements Directory {
/**
* @var resource
*/
public $context;
/**
* @var \Iterator
*/
protected $iterator;
/**
* Load the source from the stream context and return the context options
*
* @param string $name
* @return array
* @throws \BadMethodCallException
*/
protected function loadContext($name = null) {
$context = parent::loadContext($name);
if (isset($context['iterator'])) {
$this->iterator = $context['iterator'];
} elseif (isset($context['array'])) {
$this->iterator = new \ArrayIterator($context['array']);
} else {
throw new \BadMethodCallException('Invalid context, iterator or array not set');
}
return $context;
}
/**
* @param string $path
* @param array $options
* @return bool
*/
public function dir_opendir($path, $options) {
$this->loadContext();
return true;
}
/**
* @return string|bool
*/
public function dir_readdir() {
if ($this->iterator->valid()) {
$result = $this->iterator->current();
$this->iterator->next();
return $result;
} else {
return false;
}
}
/**
* @return bool
*/
public function dir_closedir() {
return true;
}
/**
* @return bool
*/
public function dir_rewinddir() {
$this->iterator->rewind();
return true;
}
/**
* Creates a directory handle from the provided array or iterator
*
* @param \Iterator | array $source
* @return resource|false
*
* @throws \BadMethodCallException
*/
public static function wrap($source) {
if ($source instanceof \Iterator) {
$options = [
'iterator' => $source
];
} elseif (is_array($source)) {
$options = [
'array' => $source
];
} else {
throw new \BadMethodCallException('$source should be an Iterator or array');
}
return self::wrapSource(self::NO_SOURCE_DIR, $options);
}
}