Browse Source

gallery html fix

amic 1 month ago
parent
commit
9a431d7182

+ 1 - 1
forks/galleryManager/views/galleryManager.php

@@ -148,7 +148,7 @@ $gid = $this->context->model->galleryId;
     }
 	function slSave(e, id, obj){
 		title = $("input[name='photo["+e+"][name]']").val();
-		description = $("textarea[name='photo["+e+"][description]']").val();
+		description = encodeURIComponent($("textarea[name='photo["+e+"][description]']").val());
 		$.ajax( 'ajaxgalleryslide?id='+e+'&gid='+id+'&title='+title+'&description='+description).done(function( data ) {
 			d = JSON.parse(data);
 			$('#md-'+d.id).modal('hide');

+ 1 - 1
modules/manager/controllers/NewsController.php

@@ -583,7 +583,7 @@ class NewsController extends BaseController
 			$id = Yii::$app->request->get('id');
 			$gid = Yii::$app->request->get('gid');
 			$title = Yii::$app->request->get('title');
-			$description = Yii::$app->request->get('description');
+			$description = rawurldecode(Yii::$app->request->get('description'));
 			//p = new \manager\models\GalleryImage->getUrl(1,'small');
 			$db = \Yii::$app->db;
 			$gallery = \manager\models\Gallery::find()->andWhere(['id'=>$gid])->one();