mirror of
https://github.com/sigmasternchen/shochu
synced 2025-03-15 07:38:55 +00:00
set all variables to local
This commit is contained in:
parent
10b8f41076
commit
2b86c44b22
7 changed files with 24 additions and 19 deletions
|
@ -1,13 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
getCookie() {
|
||||
key="$1"
|
||||
local key="$1"
|
||||
echo "$HTTP_COOKIE" | tr ';' $'\n' | grep -e "^$1=" | cut -d= -f2 | sed -r 's/\s*$//g'
|
||||
}
|
||||
|
||||
setCookie() {
|
||||
key="$1"
|
||||
value="$2"
|
||||
attributes="$3"
|
||||
local key="$1"
|
||||
local value="$2"
|
||||
local attributes="$3"
|
||||
header "Set-Cookie" "$key=$value; $attributes"
|
||||
}
|
||||
|
|
17
mysql.sh
17
mysql.sh
|
@ -26,16 +26,15 @@ query() {
|
|||
|
||||
escape() {
|
||||
echo "$1" |
|
||||
sed "s/\\/\\\\/g" |
|
||||
sed 's/\\/\\\\/g' |
|
||||
sed "s/'/\\'/g" |
|
||||
sed "s/\"/\\\"/g" |
|
||||
sed "s/\n/\\n/g" |
|
||||
sed "s/\r/\\r/g" |
|
||||
sed "s/\t/\\t/g" |
|
||||
sed "s/\Z/\\Z/g" |
|
||||
sed "s/\b/\\b/g" |
|
||||
sed "s/%/\\%/g" |
|
||||
sed "s/_/\\_/g"
|
||||
sed 's/\"/\\\"/g' |
|
||||
sed 's/\n/\\n/g' |
|
||||
sed 's/\r/\\r/g' |
|
||||
sed 's/\t/\\t/g' |
|
||||
sed 's/\Z/\\Z/g' |
|
||||
sed 's/%/\\%/g' |
|
||||
sed 's/_/\\_/g'
|
||||
}
|
||||
|
||||
getColumns() {
|
||||
|
|
|
@ -20,8 +20,8 @@ _default404() {
|
|||
}
|
||||
|
||||
_matchPaths() {
|
||||
actual="$1"
|
||||
search="$2"
|
||||
local actual="$1"
|
||||
local search="$2"
|
||||
|
||||
# TODO: add wildcards
|
||||
test "$actual" = "$search"
|
||||
|
|
|
@ -32,8 +32,8 @@ _getSession() {
|
|||
}
|
||||
|
||||
_newSessionId() {
|
||||
base="$(date -Ins -u)"
|
||||
random="$RANDOM"
|
||||
local base="$(date -Ins -u)"
|
||||
local random="$RANDOM"
|
||||
while _getSession "$(echo "$base$random" | md5sum | cut -d' ' -f1)" > /dev/null; do
|
||||
random="$RANDOM"
|
||||
done
|
||||
|
|
2
shinden
2
shinden
|
@ -1 +1 @@
|
|||
Subproject commit 6b398f25719243c102f7a91972966538ed23dd01
|
||||
Subproject commit 0964fdc24ff68d84f419354f227b12cb9ff27df3
|
6
uri.sh
6
uri.sh
|
@ -17,6 +17,12 @@ queryString() {
|
|||
|
||||
_formData=""
|
||||
|
||||
cacheFormData() {
|
||||
if test -z "$_formData"; then
|
||||
_formData="$(cat)"
|
||||
fi
|
||||
}
|
||||
|
||||
formData() {
|
||||
if test -z "$_formData"; then
|
||||
_formData="$(cat)"
|
||||
|
|
2
utils.sh
2
utils.sh
|
@ -4,7 +4,7 @@ _hasStatus=0
|
|||
|
||||
status() {
|
||||
_hasStatus=1
|
||||
status="$1"
|
||||
local status="$1"
|
||||
echo -n "Status: $status "
|
||||
case "$status" in
|
||||
100) echo "Continue" ;;
|
||||
|
|
Loading…
Reference in a new issue