Skip to content

Commit

Permalink
Fixed: Webcam bugs when PHP Version lower than 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
mucill committed Apr 5, 2014
1 parent 082d9d9 commit 9f20038
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions admin/modules/membership/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,19 @@
die('<div class="errorBox">You dont have enough privileges to view this section</div>');
}

/* Just In Case for PHP < 5.4 */
/* Taken From imageman (http://www.php.net/manual/en/function.getimagesizefromstring.php#113976) */
/* Make sure to set allow_url_fopen = on inside your php.ini */
if (version_compare(phpversion(), '5.4', '<'))
{
function getimagesizefromstring($string_data)
{
$uri = 'data://application/octet-stream;base64,' . base64_encode($string_data);
return getimagesize($uri);
}
}


/* REMOVE IMAGE */
if (isset($_POST['removeImage']) && isset($_POST['mimg']) && isset($_POST['img'])) {
$_delete = $dbs->query(sprintf('UPDATE member SET member_image=NULL WHERE member_id=%d', $_POST['mimg']));
Expand Down

0 comments on commit 9f20038

Please sign in to comment.