Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

card-571-call-sort-method #8468

Merged
merged 1 commit into from Jan 4, 2016
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/com/dotmarketing/factories/InodeFactory.java
Expand Up @@ -1442,7 +1442,7 @@ public static java.util.List getInodesOfClassByConditionAndOrderBy(Class c, Stri
throw new DotStateException("Identifiers are no longer Inodes!");
}

orderby = SQLUtil.sanitizeParameter(orderby);
orderby = SQLUtil.sanitizeSortBy(orderby);
direction = SQLUtil.sanitizeParameter(direction);

try {
Expand Down
4 changes: 2 additions & 2 deletions src/com/dotmarketing/factories/WebAssetFactory.java
Expand Up @@ -890,7 +890,7 @@ else if(list.size() < internalLimit)
@SuppressWarnings("unchecked")
public static List<WebAsset> getAssetsWorkingWithPermission(Class c, int limit,
int offset, String orderby, String parent, User user) {
orderby = SQLUtil.sanitizeParameter(orderby);
orderby = SQLUtil.sanitizeSortBy(orderby);
parent = SQLUtil.sanitizeParameter(parent);

HibernateUtil dh = new HibernateUtil(c);
Expand Down Expand Up @@ -2033,7 +2033,7 @@ public PaginatedArrayList<PermissionAsset> getAssetsAndPermissions(String hostId

parent = SQLUtil.sanitizeParameter(parent);
query = SQLUtil.sanitizeParameter(query);
orderBy = SQLUtil.sanitizeParameter(orderBy);
orderBy = SQLUtil.sanitizeSortBy(orderBy);

AssetType type = AssetType.getObject(tableName.toUpperCase());
java.util.List<? extends Permissionable> elements = null;
Expand Down
Expand Up @@ -271,7 +271,7 @@ protected List<Category> getChildren(Categorizable parent) throws DotDataExcepti
@Override
protected List<Category> getChildren(Categorizable parent, String orderBy)
throws DotDataException {
orderBy = SQLUtil.sanitizeParameter(orderBy);
orderBy = SQLUtil.sanitizeSortBy(orderBy);
HibernateUtil hu = new HibernateUtil(Category.class);
hu.setSQLQuery("select {category.*} from inode category_1_, category, tree where " +
"category.inode = tree.child and tree.parent = ? and category_1_.inode = category.inode " +
Expand All @@ -284,7 +284,7 @@ protected List<Category> getChildren(Categorizable parent, String orderBy)
@Override
protected List<Category> getChildren(Categorizable parent, String orderBy,
String relationType) throws DotDataException {
orderBy = SQLUtil.sanitizeParameter(orderBy);
orderBy = SQLUtil.sanitizeSortBy(orderBy);

if(!UtilMethods.isSet(orderBy))
orderBy = "tree_order";
Expand Down Expand Up @@ -485,7 +485,7 @@ protected List<Category> findTopLevelCategories() throws DotDataException {
@Override
protected List<Category> findTopLevelCategoriesByFilter(String filter, String sort) throws DotDataException {
filter = SQLUtil.sanitizeParameter(filter);
sort = SQLUtil.sanitizeParameter(sort);
sort = SQLUtil.sanitizeSortBy(sort);
HibernateUtil dh = new HibernateUtil(Category.class);
StringBuilder sql = new StringBuilder();
sql.append("SELECT {category.*} from category category left join tree tree on category.inode = tree.child, ");
Expand Down Expand Up @@ -535,7 +535,7 @@ protected void deleteChildren(String inode) {
protected List<Category> findChildrenByFilter(String inode, String filter, String sort) throws DotDataException {
inode = SQLUtil.sanitizeParameter(inode);
filter = SQLUtil.sanitizeParameter(filter);
sort = SQLUtil.sanitizeParameter(sort);
sort = SQLUtil.sanitizeSortBy(sort);

HibernateUtil dh = new HibernateUtil(Category.class);
StringBuilder sql = new StringBuilder();
Expand All @@ -549,7 +549,7 @@ protected List<Category> findChildrenByFilter(String inode, String filter, Strin

private String getFilterAndSortSQL(String filter, String sort) {
filter = SQLUtil.sanitizeParameter(filter);
sort = SQLUtil.sanitizeParameter(sort);
sort = SQLUtil.sanitizeSortBy(sort);

StringBuilder sb = new StringBuilder();

Expand Down
2 changes: 1 addition & 1 deletion src/com/dotmarketing/tag/business/TagAPIImpl.java
Expand Up @@ -126,7 +126,7 @@ public java.util.List<Tag> getTagByUser(String userId) {
public java.util.List<Tag> getFilteredTags(String tagName, String hostFilter, boolean globalTagsFilter, String sort, int start, int count) {
try {

sort = SQLUtil.sanitizeParameter(sort);
sort = SQLUtil.sanitizeSortBy(sort);

HibernateUtil dh = new HibernateUtil(Tag.class);
List list = new java.util.ArrayList();
Expand Down