@@ -13,11 +13,13 @@ discard block |
||
| 13 | 13 | <?php $__db_h = new db_helper(); ?> |
| 14 | 14 | <?php $__time_h = new time_helper(); ?> |
| 15 | 15 | <?php |
| 16 | - if(isset($_SESSION['siteusername'])) |
|
| 17 | - $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 16 | + if(isset($_SESSION['siteusername'])) { |
|
| 17 | + $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 18 | + } |
|
| 18 | 19 | |
| 19 | - if(!$__user_h->user_exists($_GET['n'])) |
|
| 20 | - header("Location: /?userdoesntexist"); |
|
| 20 | + if(!$__user_h->user_exists($_GET['n'])) { |
|
| 21 | + header("Location: /?userdoesntexist"); |
|
| 22 | + } |
|
| 21 | 23 | |
| 22 | 24 | $_user = $__user_h->fetch_user_username($_GET['n']); |
| 23 | 25 | |
@@ -40,10 +42,11 @@ discard block |
||
| 40 | 42 | |
| 41 | 43 | if ( |
| 42 | 44 | ctype_xdigit($colorCode) && |
| 43 | - (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
|
| 44 | - return true; |
|
| 45 | - |
|
| 46 | - else return false; |
|
| 45 | + (strlen($colorCode) == 6 || strlen($colorCode) == 3)) { |
|
| 46 | + return true; |
|
| 47 | + } else { |
|
| 48 | + return false; |
|
| 49 | + } |
|
| 47 | 50 | } |
| 48 | 51 | |
| 49 | 52 | $_user['subscribed'] = $__user_h->if_subscribed(@$_SESSION['siteusername'], $_user['username']); |
@@ -76,8 +79,9 @@ discard block |
||
| 76 | 79 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
| 77 | 80 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
| 78 | 81 | |
| 79 | - if(isset($_SESSION['siteusername'])) |
|
| 80 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 82 | + if(isset($_SESSION['siteusername'])) { |
|
| 83 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 84 | + } |
|
| 81 | 85 | |
| 82 | 86 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 83 | 87 | $error = array(); |
@@ -146,8 +150,9 @@ discard block |
||
| 146 | 150 | <div class="channel_customization"><?php echo require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 147 | 151 | <?php } ?> |
| 148 | 152 | <?php |
| 149 | - if(empty(trim($_user['bio']))) |
|
| 150 | - $_user['bio'] = "This user has no description."; |
|
| 153 | + if(empty(trim($_user['bio']))) { |
|
| 154 | + $_user['bio'] = "This user has no description."; |
|
| 155 | + } |
|
| 151 | 156 | ?> |
| 152 | 157 | <div id="content"> |
| 153 | 158 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |
@@ -12,14 +12,22 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | public function sh_exec(string $cmd, string $outputfile = "", string $pidfile = "", bool $mergestderror = true, bool $bg = false) { |
| 14 | 14 | $fullcmd = $cmd; |
| 15 | - if(strlen($outputfile) > 0) $fullcmd .= " >> " . $outputfile; |
|
| 16 | - if($mergestderror) $fullcmd .= " 2>&1"; |
|
| 15 | + if(strlen($outputfile) > 0) { |
|
| 16 | + $fullcmd .= " >> " . $outputfile; |
|
| 17 | + } |
|
| 18 | + if($mergestderror) { |
|
| 19 | + $fullcmd .= " 2>&1"; |
|
| 20 | + } |
|
| 17 | 21 | |
| 18 | 22 | if($bg) { |
| 19 | 23 | $fullcmd = "nohup " . $fullcmd . " &"; |
| 20 | - if(strlen($pidfile)) $fullcmd .= " echo $! > " . $pidfile; |
|
| 24 | + if(strlen($pidfile)) { |
|
| 25 | + $fullcmd .= " echo $! > " . $pidfile; |
|
| 26 | + } |
|
| 21 | 27 | } else { |
| 22 | - if(strlen($pidfile) > 0) $fullcmd .= "; echo $$ > " . $pidfile; |
|
| 28 | + if(strlen($pidfile) > 0) { |
|
| 29 | + $fullcmd .= "; echo $$ > " . $pidfile; |
|
| 30 | + } |
|
| 23 | 31 | } |
| 24 | 32 | shell_exec($fullcmd); |
| 25 | 33 | } |
@@ -34,8 +42,7 @@ discard block |
||
| 34 | 42 | } |
| 35 | 43 | |
| 36 | 44 | fclose($handle); |
| 37 | - } |
|
| 38 | - catch(Exception $e) { |
|
| 45 | + } catch(Exception $e) { |
|
| 39 | 46 | trigger_error("file_get_contents_chunked::" . $e->getMessage(),E_USER_NOTICE); |
| 40 | 47 | return false; |
| 41 | 48 | } |
@@ -18,12 +18,14 @@ |
||
| 18 | 18 | $video['title'] = htmlspecialchars($video['title']); |
| 19 | 19 | $video['description'] = $__video_h->shorten_description($video['description'], 50); |
| 20 | 20 | |
| 21 | - if(!$__video_h->video_exists($_GET['v'])) |
|
| 22 | - header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag."); |
|
| 21 | + if(!$__video_h->video_exists($_GET['v'])) { |
|
| 22 | + header("Location: /?error=Your video has not processed correctly. Try reuploading it with a shorter title, description, or tag."); |
|
| 23 | + } |
|
| 23 | 24 | |
| 24 | - if($_SESSION['siteusername'] != $video['author']) |
|
| 25 | - header("Location: /"); |
|
| 26 | -?> |
|
| 25 | + if($_SESSION['siteusername'] != $video['author']) { |
|
| 26 | + header("Location: /"); |
|
| 27 | + } |
|
| 28 | + ?> |
|
| 27 | 29 | <!DOCTYPE html> |
| 28 | 30 | <html> |
| 29 | 31 | <head> |
@@ -26,8 +26,9 @@ |
||
| 26 | 26 | if(!isset($error['message'])) { |
| 27 | 27 | $characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'; |
| 28 | 28 | $result = ''; |
| 29 | - for ($i = 0; $i < 11; $i++) |
|
| 30 | - $rid .= $characters[mt_rand(0, 63)]; |
|
| 29 | + for ($i = 0; $i < 11; $i++) { |
|
| 30 | + $rid .= $characters[mt_rand(0, 63)]; |
|
| 31 | + } |
|
| 31 | 32 | $stmt = $__db->prepare("INSERT INTO playlists (title, description, rid, author) VALUES (:title, :desc, :rid, :username)"); |
| 32 | 33 | $stmt->bindParam(":title", $_POST['title']); |
| 33 | 34 | $stmt->bindParam(":desc", $_POST['comment']); |
@@ -13,11 +13,13 @@ discard block |
||
| 13 | 13 | <?php $__db_h = new db_helper(); ?> |
| 14 | 14 | <?php $__time_h = new time_helper(); ?> |
| 15 | 15 | <?php |
| 16 | - if(isset($_SESSION['siteusername'])) |
|
| 17 | - $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 16 | + if(isset($_SESSION['siteusername'])) { |
|
| 17 | + $_user_hp = $__user_h->fetch_user_username($_SESSION['siteusername']); |
|
| 18 | + } |
|
| 18 | 19 | |
| 19 | - if(!$__user_h->user_exists($_GET['n'])) |
|
| 20 | - header("Location: /?userdoesntexist"); |
|
| 20 | + if(!$__user_h->user_exists($_GET['n'])) { |
|
| 21 | + header("Location: /?userdoesntexist"); |
|
| 22 | + } |
|
| 21 | 23 | |
| 22 | 24 | $_user = $__user_h->fetch_user_username($_GET['n']); |
| 23 | 25 | |
@@ -40,10 +42,11 @@ discard block |
||
| 40 | 42 | |
| 41 | 43 | if ( |
| 42 | 44 | ctype_xdigit($colorCode) && |
| 43 | - (strlen($colorCode) == 6 || strlen($colorCode) == 3)) |
|
| 44 | - return true; |
|
| 45 | - |
|
| 46 | - else return false; |
|
| 45 | + (strlen($colorCode) == 6 || strlen($colorCode) == 3)) { |
|
| 46 | + return true; |
|
| 47 | + } else { |
|
| 48 | + return false; |
|
| 49 | + } |
|
| 47 | 50 | } |
| 48 | 51 | |
| 49 | 52 | $_user['subscribers'] = $__user_h->fetch_subs_count($_user['username']); |
@@ -75,8 +78,9 @@ discard block |
||
| 75 | 78 | if(!check_valid_colorhex($_user['primary_color_text']) && strlen($_user['primary_color_text']) != 6) { $_user['primary_color_text'] = ""; } |
| 76 | 79 | if(!check_valid_colorhex($_user['2009_bgcolor']) && strlen($_user['2009_bgcolor']) != 6) { $_user['2009_bgcolor'] = ""; } |
| 77 | 80 | |
| 78 | - if(isset($_SESSION['siteusername'])) |
|
| 79 | - $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 81 | + if(isset($_SESSION['siteusername'])) { |
|
| 82 | + $__user_i->check_view_channel($_user['username'], @$_SESSION['siteusername']); |
|
| 83 | + } |
|
| 80 | 84 | |
| 81 | 85 | if($_SERVER['REQUEST_METHOD'] == 'POST') { |
| 82 | 86 | $error = array(); |
@@ -146,8 +150,9 @@ discard block |
||
| 146 | 150 | <div class="channel_customization"><?php echo require($_SERVER['DOCUMENT_ROOT'] . "/s/mod/channel_customization.php"); ?></div> |
| 147 | 151 | <?php } ?> |
| 148 | 152 | <?php |
| 149 | - if(empty(trim($_user['bio']))) |
|
| 150 | - $_user['bio'] = "This user has no description."; |
|
| 153 | + if(empty(trim($_user['bio']))) { |
|
| 154 | + $_user['bio'] = "This user has no description."; |
|
| 155 | + } |
|
| 151 | 156 | ?> |
| 152 | 157 | <div id="content"> |
| 153 | 158 | <div class="subscription-menu-expandable subscription-menu-expandable-channels3 yt-rounded ytg-wide hid"> |