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

Invalid & escape in URL - Unable to share or download pictures, but video download+share works #190

Closed
Catfriend1 opened this issue Jun 20, 2024 · 4 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Catfriend1
Copy link

Catfriend1 commented Jun 20, 2024

I've made sure all permissions were granted and I selected a write-able directory on my internal storage in both cases.

PiwigoNG: most recent version from GitHub

Log when hitting the share button for a picture:

06-20 15:07:10.750 26225 29452 I flutter : [GET] null
06-20 15:07:10.800 26225 29452 I flutter : [400] null
06-20 15:07:10.800 26225 29452 I flutter : Http status error [400]
06-20 15:07:10.800 26225 29452 I flutter : Instance of 'ResponseBody'
06-20 15:07:10.800 26225 29452 I flutter : null
06-20 15:07:10.800 26225 29452 I flutter : Download images: Http status error [400]
06-20 15:07:10.800 26225 29452 I flutter : []

Log when hitting the share button for a video:

06-20 15:19:34.595 22017 22046 I flutter : [Instance of 'XFile']

The URL in question according to the nginx log is:
https://(server):(port)/action.php?id=27143&part=e
If I open this via Chrome on PC, it works.

I noticed the log saying "amp;" - Conclusion: I think the app has an escaping error here.

IP - - [20/Jun/2024:15:55:56 +0200] "GET /action.php?id=27143&part=e HTTP/1.1" 400 36 "-" "-"

Via Chrome on PC, I can reproduce the error:
image

@Catfriend1 Catfriend1 changed the title Unable to share or download pictures on Android 14, but works on Android 10 phone Unable to share or download pictures, but video download+share works Jun 20, 2024
@Catfriend1 Catfriend1 changed the title Unable to share or download pictures, but video download+share works Invalid &a,mp; escape in URL - Unable to share or download pictures, but video download+share works Jun 20, 2024
@Catfriend1 Catfriend1 changed the title Invalid &a,mp; escape in URL - Unable to share or download pictures, but video download+share works Invalid & escape in URL - Unable to share or download pictures, but video download+share works Jun 20, 2024
@Catfriend1
Copy link
Author

I've found a temporary workaround on the server side (to be used until the app is fixed giving & instead & as query params).

In /var/www/piwigo/action.php

// Custom: Fix Piwigo-NG Android app
if (strpos($_SERVER['QUERY_STRING'], '&part=e') !== false) {
    $_GET['part'] = 'e';
}


// Put code above before this line (l. 73)
if (!isset($_GET['id'])
    or !is_numeric($_GET['id'])
    or !isset($_GET['part'])
    or !in_array($_GET['part'], array('e','r','f') ) )

@Catfriend1
Copy link
Author

@remi-martin Could you please take a look? I think this is pretty easy to fix as the app queries pictures with "&part=e" to action.php instead of "&part=e"

@remi-martin remi-martin self-assigned this Jun 24, 2024
@remi-martin remi-martin added the bug Something isn't working label Jun 24, 2024
@remi-martin
Copy link
Collaborator

remi-martin commented Jul 5, 2024

Looks like I have another issue when I try to share:

I/flutter (13097): [GET] null
I/flutter (13097): [200] null
I/flutter (13097): [Instance of 'XFile']
E/flutter (13097): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: MissingPluginException(No implementation found for method shareFilesWithResult on channel dev.fluttercommunity.plus/share)
E/flutter (13097): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:332:7)
E/flutter (13097): <asynchronous suspension>
E/flutter (13097): #1      MethodChannelShare.shareFilesWithResult (package:share_plus_platform_interface/method_channel/method_channel_share.dart:140:9)
E/flutter (13097): <asynchronous suspension>
E/flutter (13097): 

*Edit: will be fixed with package version upgrade

@Catfriend1
Copy link
Author

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants