Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
etherpad-lite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
runcon
etherpad-lite
Commits
8d27f3cf
Commit
8d27f3cf
authored
7 years ago
by
ilmar
Browse files
Options
Downloads
Patches
Plain Diff
upgrade to 1.6.5
parent
7cc7bb1a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
bin/checkAllPads.js
+145
-0
145 additions, 0 deletions
bin/checkAllPads.js
src/locales/pms.json
+48
-0
48 additions, 0 deletions
src/locales/pms.json
src/node/hooks/express/isValidJSONPName.js
+83
-0
83 additions, 0 deletions
src/node/hooks/express/isValidJSONPName.js
with
276 additions
and
0 deletions
bin/checkAllPads.js
0 → 100644
+
145
−
0
View file @
8d27f3cf
/*
This is a debug tool. It checks all revisions for data corruption
*/
if
(
process
.
argv
.
length
!=
2
)
{
console
.
error
(
"
Use: node bin/checkAllPads.js
"
);
process
.
exit
(
1
);
}
//initalize the variables
var
db
,
settings
,
padManager
;
var
npm
=
require
(
"
../src/node_modules/npm
"
);
var
async
=
require
(
"
../src/node_modules/async
"
);
var
Changeset
=
require
(
"
../src/static/js/Changeset
"
);
async
.
series
([
//load npm
function
(
callback
)
{
npm
.
load
({},
callback
);
},
//load modules
function
(
callback
)
{
settings
=
require
(
'
../src/node/utils/Settings
'
);
db
=
require
(
'
../src/node/db/DB
'
);
//initalize the database
db
.
init
(
callback
);
},
//load pads
function
(
callback
)
{
padManager
=
require
(
'
../src/node/db/PadManager
'
);
padManager
.
listAllPads
(
function
(
err
,
res
)
{
padIds
=
res
.
padIDs
;
callback
(
err
);
});
},
function
(
callback
)
{
async
.
forEach
(
padIds
,
function
(
padId
,
callback
)
{
padManager
.
getPad
(
padId
,
function
(
err
,
pad
)
{
if
(
err
)
{
callback
(
err
);
}
//check if the pad has a pool
if
(
pad
.
pool
===
undefined
)
{
console
.
error
(
"
[
"
+
pad
.
id
+
"
] Missing attribute pool
"
);
callback
();
return
;
}
//create an array with key kevisions
//key revisions always save the full pad atext
var
head
=
pad
.
getHeadRevisionNumber
();
var
keyRevisions
=
[];
for
(
var
i
=
0
;
i
<
head
;
i
+=
100
)
{
keyRevisions
.
push
(
i
);
}
//run trough all key revisions
async
.
forEachSeries
(
keyRevisions
,
function
(
keyRev
,
callback
)
{
//create an array of revisions we need till the next keyRevision or the End
var
revisionsNeeded
=
[];
for
(
var
i
=
keyRev
;
i
<=
keyRev
+
100
&&
i
<=
head
;
i
++
)
{
revisionsNeeded
.
push
(
i
);
}
//this array will hold all revision changesets
var
revisions
=
[];
//run trough all needed revisions and get them from the database
async
.
forEach
(
revisionsNeeded
,
function
(
revNum
,
callback
)
{
db
.
db
.
get
(
"
pad:
"
+
pad
.
id
+
"
:revs:
"
+
revNum
,
function
(
err
,
revision
)
{
revisions
[
revNum
]
=
revision
;
callback
(
err
);
});
},
function
(
err
)
{
if
(
err
)
{
callback
(
err
);
return
;
}
//check if the revision exists
if
(
revisions
[
keyRev
]
==
null
)
{
console
.
error
(
"
[
"
+
pad
.
id
+
"
] Missing revision
"
+
keyRev
);
callback
();
return
;
}
//check if there is a atext in the keyRevisions
if
(
revisions
[
keyRev
].
meta
===
undefined
||
revisions
[
keyRev
].
meta
.
atext
===
undefined
)
{
console
.
error
(
"
[
"
+
pad
.
id
+
"
] Missing atext in revision
"
+
keyRev
);
callback
();
return
;
}
var
apool
=
pad
.
pool
;
var
atext
=
revisions
[
keyRev
].
meta
.
atext
;
for
(
var
i
=
keyRev
+
1
;
i
<=
keyRev
+
100
&&
i
<=
head
;
i
++
)
{
try
{
//console.log("[" + pad.id + "] check revision " + i);
var
cs
=
revisions
[
i
].
changeset
;
atext
=
Changeset
.
applyToAText
(
cs
,
atext
,
apool
);
}
catch
(
e
)
{
console
.
error
(
"
[
"
+
pad
.
id
+
"
] Bad changeset at revision
"
+
i
+
"
-
"
+
e
.
message
);
callback
();
return
;
}
}
callback
();
});
},
callback
);
});
},
callback
);
}
],
function
(
err
)
{
if
(
err
)
throw
err
;
else
{
console
.
log
(
"
finished
"
);
process
.
exit
(
0
);
}
});
This diff is collapsed.
Click to expand it.
src/locales/pms.json
0 → 100644
+
48
−
0
View file @
8d27f3cf
{
"@metadata"
:
{
"authors"
:
[
"Borichèt"
]
},
"index.newPad"
:
"Feuj neuv"
,
"index.createOpenPad"
:
"o creé/duverté un feuj antitolà:"
,
"pad.toolbar.bold.title"
:
"Grassèt (Ctrl+B)"
,
"pad.toolbar.italic.title"
:
"Corsiv (Ctrl+I)"
,
"pad.toolbar.underline.title"
:
"Sotlignà (Ctrl+U)"
,
"pad.toolbar.strikethrough.title"
:
"Barà (Ctrl+5)"
,
"pad.toolbar.ol.title"
:
"Lista ordinà (Ctrl+Shift+N)"
,
"pad.toolbar.ul.title"
:
"Lista nen ordinà (Ctrl+Shift+L)"
,
"pad.toolbar.indent.title"
:
"Andenté (TAB)"
,
"pad.toolbar.unindent.title"
:
"Disandenté (Maj+TAB)"
,
"pad.toolbar.undo.title"
:
"Anulé (Ctrl+Z)"
,
"pad.toolbar.redo.title"
:
"Ristabilì (Ctrl+Y)"
,
"pad.toolbar.clearAuthorship.title"
:
"Dëscancelé ij color ch'a identìfico j'autor (Ctrl+Shift+C)"
,
"pad.toolbar.import_export.title"
:
"Amporté/Esporté da/vers dij formà d'archivi diferent"
,
"pad.toolbar.timeslider.title"
:
"Stòria dinàmica"
,
"pad.toolbar.savedRevision.title"
:
"Argistré la revision"
,
"pad.toolbar.settings.title"
:
"Paràmeter"
,
"pad.toolbar.embed.title"
:
"Partagé e antëgré ës feuj"
,
"pad.toolbar.showusers.title"
:
"Smon-e j'utent ansima a 's feuj"
,
"pad.colorpicker.save"
:
"Argistré"
,
"pad.colorpicker.cancel"
:
"Anulé"
,
"pad.loading"
:
"Antramentr ch'as caria…"
,
"pad.noCookie"
:
"Ël bëscotin a l'é nen ëstàit trovà. Për piasì, ch'a autorisa ij bëscotin su sò navigador!"
,
"pad.passwordRequired"
:
"A l'ha da manca ëd na ciav për acede a cost feuj-sì"
,
"pad.permissionDenied"
:
"A l'ha nen ël përmess d'acede a 's feuj-sì"
,
"pad.wrongPassword"
:
"Soa ciav a l'era nen giusta"
,
"pad.settings.padSettings"
:
"Paràmeter dël feuj"
,
"pad.settings.myView"
:
"Mia vista"
,
"pad.settings.stickychat"
:
"Ciaciarade sempe an slë scren"
,
"pad.settings.chatandusers"
:
"Smon-e le ciaciarade e j'utent"
,
"pad.settings.colorcheck"
:
"Color d'identificassion"
,
"pad.settings.linenocheck"
:
"Nùmer ëd linia"
,
"pad.settings.rtlcheck"
:
"Ël contnù, dev-lo esse lesù da drita a snistra?"
,
"pad.settings.fontType"
:
"Sòrt ëd caràter:"
,
"pad.settings.globalView"
:
"Vista d'ansem"
,
"pad.settings.language"
:
"Lenga:"
,
"pad.importExport.import_export"
:
"Amporté/Esporté"
,
"pad.importExport.import"
:
"Carié n'archivi o document ëd test"
,
"pad.importExport.importSuccessful"
:
"Bele fàit!"
,
"pad.importExport.export"
:
"Esporté ël feuj atual coma:"
,
"pad.importExport.exportetherpad"
:
"Etherpad"
}
This diff is collapsed.
Click to expand it.
src/node/hooks/express/isValidJSONPName.js
0 → 100644
+
83
−
0
View file @
8d27f3cf
const
RESERVED_WORDS
=
[
'
abstract
'
,
'
arguments
'
,
'
await
'
,
'
boolean
'
,
'
break
'
,
'
byte
'
,
'
case
'
,
'
catch
'
,
'
char
'
,
'
class
'
,
'
const
'
,
'
continue
'
,
'
debugger
'
,
'
default
'
,
'
delete
'
,
'
do
'
,
'
double
'
,
'
else
'
,
'
enum
'
,
'
eval
'
,
'
export
'
,
'
extends
'
,
'
false
'
,
'
final
'
,
'
finally
'
,
'
float
'
,
'
for
'
,
'
function
'
,
'
goto
'
,
'
if
'
,
'
implements
'
,
'
import
'
,
'
in
'
,
'
instanceof
'
,
'
int
'
,
'
interface
'
,
'
let
'
,
'
long
'
,
'
native
'
,
'
new
'
,
'
null
'
,
'
package
'
,
'
private
'
,
'
protected
'
,
'
public
'
,
'
return
'
,
'
short
'
,
'
static
'
,
'
super
'
,
'
switch
'
,
'
synchronized
'
,
'
this
'
,
'
throw
'
,
'
throws
'
,
'
transient
'
,
'
true
'
,
'
try
'
,
'
typeof
'
,
'
var
'
,
'
void
'
,
'
volatile
'
,
'
while
'
,
'
with
'
,
'
yield
'
];
const
regex
=
/^
[
a-zA-Z_$
][
0-9a-zA-Z_$
]
*
(?:\[(?:
".+"|
\'
.+
\'
|
\d
+
)\])
*
?
$/
;
module
.
exports
.
check
=
function
(
inputStr
)
{
var
isValid
=
true
;
inputStr
.
split
(
"
.
"
).
forEach
(
function
(
part
)
{
if
(
!
regex
.
test
(
part
))
{
isValid
=
false
;
}
if
(
RESERVED_WORDS
.
indexOf
(
part
)
!==
-
1
)
{
isValid
=
false
;
}
});
return
isValid
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment