Infinite Slash Escaping
-
Whenever adding or updating a gallery, the Gallery Path keeps updating with more and more escaped back-slashes like so:
\\\\\\\\\\\\\\\\wp-content\\\\\\\\\\\\\\\\gallery\\\\\\\\\\\\\\\\test-gallery/If I were to update again, more slashes would be added. This seems like a bug, let me know if you need any more information from me on this.
-
@howdy_mcgee – We may have a correction for this although it is still being tested. You are welcome to try the following:
… via FTP, go to ../wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/templates/manage_gallery/gallery_path_field.php
replace this line (should be line 6)
value="<?php echo esc_attr(str_replace('\\', DIRECTORY_SEPARATOR, $gallery->path)) ?>"with this
value="<?php echo esc_attr(preg_replace('#[/\\]+#', DIRECTORY_SEPARATOR, $gallery->path )); ?>"Please let us know if this helps.
Thanks!
– Cais.
-
This reply was modified 8 years, 3 months ago by
Imagely.
I think that works. I had to add an additional escape for the last bracket, so the final code looks like this:
<?php echo esc_attr( preg_replace('#[/\\\]+#', DIRECTORY_SEPARATOR, $gallery->path )); ?>But the above does appear to solve the issue. Hopefully a fix will be pushed out with the next update so my changes don’t get overridden >.>
Thanks for the help!
I have change the code. But it’s the same.
It think it’s a problem with the jquery.fancybox-1.3.4
I work on my local mashine.
Here is the 3 errors and 2 warnings that I see, when I look it on the chrome browser.Uncaught TypeError: Cannot read property ‘msie’ of undefined
at jquery.fancybox-1.3.4.pack.js:18
at jquery.fancybox-1.3.4.pack.js:46
jquery.min.js:2 jQuery.Deferred exception: $(…).unload is not a function TypeError: $(…).unload is not a function
at HTMLDocument.<anonymous> (http://localhost:8888/moviment/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ajax/static/ajax.min.js:51:11)
at l (https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:29375)
at c (https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:29677) undefined
w.Deferred.exceptionHook @ jquery.min.js:2
jquery.min.js:2 jQuery.Deferred exception: e.fancybox is not a function TypeError: e.fancybox is not a function
at e (http://localhost:8888/moviment/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/nextgen_fancybox_init.min.js:1:100)
at HTMLDocument.<anonymous> (http://localhost:8888/moviment/wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/lightbox/static/fancybox/nextgen_fancybox_init.min.js:1:228)
at l (https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:29375)
at c (https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js:2:29677) undefined
w.Deferred.exceptionHook @ jquery.min.js:2
jquery.min.js:2 Uncaught TypeError: $(…).unload is not a function
at HTMLDocument.<anonymous> (ajax.min.js:51)
at l (jquery.min.js:2)
at c (jquery.min.js:2)
jquery.min.js:2 Uncaught TypeError: e.fancybox is not a function
at e (nextgen_fancybox_init.min.js:1)
at HTMLDocument.<anonymous> (nextgen_fancybox_init.min.js:1)
at l (jquery.min.js:2)
at c (jquery.min.js:2)I used the code provided by Imagely and now my Gallery path is blank… I was running into the same issue as the original comment. Thoughts?
@pallen82 Try the code I’ve posted above. The original code had a mistyping in it.
@howdy_mcgee – Thanks for sharing this. I have put it back to our developers to review.
– Cais.
So when I used Howdy_Mcgee it gave me a 403 error. When I use Imagely’s version it doesn’t give me an error – it works but there is no path in the Gallery path…
@pallen82 It may be best to create a separate topic than this as this one is resolved. You may end up with a different solution or issue than we found here.
@howdy_mcgee – Agreed.
– Cais.
I’m glad to see that this bug has been finally fixed. I initially reported it 11 months ago: https://ww.wp.xz.cn/support/topic/plugin-adding-extra-slashes-to-gallery-path-when-saving-changes-on-the-gallery/
@demaier – Thanks for sharing that.
– Cais.
-
This reply was modified 8 years, 3 months ago by
The topic ‘Infinite Slash Escaping’ is closed to new replies.