|
@@ -112,7 +112,7 @@ var Prezi = (function (my) {
|
112
|
112
|
else {
|
113
|
113
|
var presIdTmp = urlValue.substring(
|
114
|
114
|
urlValue.indexOf("prezi.com/") + 10);
|
115
|
|
- if (!Util.isAlphanumeric(presIdTmp)
|
|
115
|
+ if (!isAlphanumeric(presIdTmp)
|
116
|
116
|
|| presIdTmp.indexOf('/') < 2) {
|
117
|
117
|
$.prompt.goToState('state1');
|
118
|
118
|
return false;
|
|
@@ -258,6 +258,16 @@ var Prezi = (function (my) {
|
258
|
258
|
}
|
259
|
259
|
};
|
260
|
260
|
|
|
261
|
+ /**
|
|
262
|
+ * Indicates if the given string is an alphanumeric string.
|
|
263
|
+ * Note that some special characters are also allowed (-, _ , /, &, ?, =, ;) for the
|
|
264
|
+ * purpose of checking URIs.
|
|
265
|
+ */
|
|
266
|
+ function isAlphanumeric(unsafeText) {
|
|
267
|
+ var regex = /^[a-z0-9-_\/&\?=;]+$/i;
|
|
268
|
+ return regex.test(unsafeText);
|
|
269
|
+ }
|
|
270
|
+
|
261
|
271
|
/**
|
262
|
272
|
* Returns the presentation id from the given url.
|
263
|
273
|
*/
|