Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ COPY assets ./assets
RUN npm run-script build


FROM docker.io/php:7.3-apache
FROM docker.io/php:8.4-apache
LABEL author="Devin Matte <matted@csh.rit.edu>"

RUN echo "deb-src http://deb.debian.org/debian buster main" >> /etc/apt/sources.list
Expand All @@ -36,6 +36,7 @@ RUN apt-get -yq update && \
libxml2-dev \
unzip \
wget \
fonts-roboto \
--no-install-recommends

RUN apt-get -yq build-dep imagemagick
Expand All @@ -44,10 +45,9 @@ RUN wget https://github.com/ImageMagick/ImageMagick6/archive/6.9.11-22.tar.gz &&
tar -xzvf 6.9.11-22.tar.gz && \
cd ImageMagick6-6.9.11-22 && \
./configure && \
make && \
make -j16 && \
make install && \
ldconfig /usr/local/lib && \
make check
ldconfig /usr/local/lib

RUN docker-php-ext-install mysqli && \
yes '' | pecl install imagick && docker-php-ext-enable imagick
Expand Down
2 changes: 1 addition & 1 deletion api/entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"id" => $department['id'],
"title" => $department['title'],
"code" => isset($department['code']) ? $department['code'] : null,
"number" => trim($department['number'], " ,")
"number" => $department['number'] ? trim($department['number'], " ,") : null,
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ angular.module('sm').directive('scheduleActions', function ($http, $q, shareServ
const popup = openPopup(true)

getSavedInfo().then(function (data) {
popup.location = ('http://' + window.location.hostname +
popup.location = (window.location.origin +
'/img/schedules/' + parseInt(data.id, 16) + '.png')
})
},
Expand All @@ -174,7 +174,7 @@ angular.module('sm').directive('scheduleActions', function ($http, $q, shareServ

popup.localStorage.setItem('reloadSchedule', angular.toJson(reloadSchedule))
popup.document.title = 'My Schedule'
popup.location = 'http://' + window.location.hostname + '/schedule/render/print'
popup.location = window.location.origin + '/schedule/render/print'
},

hide: function () {
Expand Down
19 changes: 1 addition & 18 deletions inc/config.env.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$get_env = function (&$var, $default = null) {
$get_env = function ($var, $default = null) {
return !empty($var) ? $var : $default;
};

Expand Down Expand Up @@ -49,23 +49,6 @@
$RUM_CLIENT_TOKEN = $get_env(getenv("RUM_CLIENT_TOKEN"), '');
$RUM_APPLICATION_ID = $get_env(getenv("RUM_APPLICATION_ID"), '');

////////////////////////////////////////////////////////////////////////////
// WORK AROUNDS
if (get_magic_quotes_gpc()) {
$process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
while (list($key, $val) = each($process)) {
foreach ($val as $k => $v) {
unset($process[$key][$k]);
if (is_array($v)) {
$process[$key][stripslashes($k)] = $v;
$process[] = &$process[$key][stripslashes($k)];
} else {
$process[$key][stripslashes($k)] = stripslashes($v);
}
}
}
unset($process);
}
////////////////////////////////////////////////////////////////////////////
// CALCULATIONS

Expand Down
5 changes: 4 additions & 1 deletion index.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@
// HACK FOR OPEN-GRAPH TAGS, I KNOW, THIS IS TERRIBLE
$path = explode('/', $_SERVER['REQUEST_URI']);
if ($path[1] == 'schedule') {
$id = (empty($path[2]))? '': hexdec($path[2]);
$id = '';
if (!empty($path[2]) && preg_match('/^[a-fA-F0-9]*$/', $path[2]) === 1) {
$id = hexdec($path[2]);
}
if(!empty($id)) {

// We are making the assumption that only new schedules with images
Expand Down
Loading