Skip to content

Commit

Permalink
Improved and signed code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lednerb committed Oct 18, 2016
1 parent b73a48a commit 75f9010
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ RUN hg clone https://bitbucket.org/wez/atomicparsley \
&& ./autogen.sh \
&& ./configure \
&& make \
&& make install
&& make install

# Download and install phpunit
RUN wget https://phar.phpunit.de/phpunit.phar \
Expand All @@ -43,4 +43,4 @@ RUN composer install
WORKDIR /var/www/html

EXPOSE 80
CMD ["apache2-foreground"]
CMD ["apache2-foreground"]
16 changes: 4 additions & 12 deletions html/video/AtomicParsleyFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class AtomicParsleyFile

/**
* AtomicParsleyFile constructor.
*
*/
public function __construct($loadFileFromPath = null)
{
Expand Down Expand Up @@ -87,7 +86,7 @@ public function readMetadata() {
$this->setGenre(substr($entry, 23));
else if(strpos($entry, 'Atom "©cmt"') !== false)
$this->setComment(substr($entry, 23));
else if(strpos($entry, 'Atom "©day"') !== false)
else if(strpos($entry, 'Atom "©day"') !== false)
$this->setYear(substr($entry, 23));
else if(strpos($entry, 'Atom "©lyr"') !== false)
$this->setLyrics(substr($entry, 23));
Expand Down Expand Up @@ -145,22 +144,17 @@ public function save() {
if(($success !== false) && filesize($this->getFullFilepath()) > 100){

foreach ($this->getMetadataBag() as $key => $value) {
$oldFilepath = $this->getFullFilepath();
$this->filename = md5(microtime()) . ".mp4";
$success = exec("AtomicParsley " .
$oldFilepath .
$this->getFullFilepath() .
$key . " " . $value .
// $key . " \"$(cat " . $dummyValueFilepath . ")\"".
" -o " . $this->getFullFilepath()
" --overWrite "
);
if ($success === false)
if ($success === false)
return false;
}

return true;
}


return false;
}

Expand Down Expand Up @@ -323,8 +317,6 @@ public function isShort() {
return $this->short;
}



/**
* Gets the value of filename.
*
Expand Down
4 changes: 1 addition & 3 deletions tests/AtomicParsleyFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ public function the_user_can_enter_special_char_in_album_field()
/** @test */
public function the_user_can_enter_much_text_in_longdesc_field()
{
$content = iconv('UTF-16', 'UTF-16', file_get_contents('/var/www/attacker/web/video/xss.txt'));


$content = iconv('UTF-16', 'UTF-16', file_get_contents('/var/www/html/video/xss.txt'));

$file = new AtomicParsleyFile();
$file->setLongdesc($content);
Expand Down

0 comments on commit 75f9010

Please sign in to comment.