* Copyright (C) 2012-2013 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 2 of the License, or
- * (at your option) any later version.
+ * it under the terms of the GNU General Public License version 2,
+ * as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
import android.view.WindowManager.LayoutParams;
import android.widget.EditText;
import android.widget.TextView;
+import android.widget.Toast;
import com.actionbarsherlock.app.SherlockDialogFragment;
import com.owncloud.android.R;
+import com.owncloud.android.lib.resources.files.FileUtils;
/**
switch (which) {
case AlertDialog.BUTTON_POSITIVE: {
mNewFilename = ((TextView)(getDialog().findViewById(R.id.user_input))).getText().toString();
+ if (!FileUtils.isValidName(mNewFilename)) {
+ Toast.makeText(getSherlockActivity(), R.string.filename_forbidden_characters, Toast.LENGTH_LONG).show();
+ return;
+ }
mResult = true;
}
case AlertDialog.BUTTON_NEGATIVE: { // fall through