Action Required: Your app is not compliant with Google Play Policies (my app name)

Developers at XXXXXXXXXXXXXXXXXX,

After a recent review, we found that your app app name(com.XXXXX.XXXXX) is not compliant with one or more of our Developer Program Policies. See below for more information about your app’s status and how to correct the issue. Publishing Status App Status: Rejected Your app has been rejected and wasn’t published due to the policy issue(s) listed below. If you submitted an update, the previous version of your app is still available on Google Play.

 Issue found: Invalid Encryption Declaration on your Data safety form We’ve detected discrepancies between how your app collects and shares user data and what was declared in your app’s Data safety form. All apps are required to complete an accurate Data safety form that discloses their data collection and sharing practices - this is required even if your app does not collect any user data.  

You have declared that user data is encrypted in transit in your app’s Data safety form and we’ve detected unencrypted network traffic that may carry user data off device.

Issue details We found an issue in the following area(s):

SPLIT_BUNDLE 125: Policy Declaration – Data Safety Section: “http://example.com”

About the Data safety section in Google Play User Data policy All developers must complete a clear and accurate Data safety section for every app detailing collection, use, and sharing of user data. Your app must be in compliance with this policy. If your app continues to be non-compliant, your app may face additional enforcement actions in the future. Please make changes to align your app’s Data safety form with the app’s behavior. This can be done by either: Updating your form in Play Console to indicate that your app does not encrypt in transit; or Encrypt the above traffic identified as unencrypted. Check out our guide for Network Security Best Practices For helpful resources, you can: Learn more about how to provide app privacy and security information for Google Play’s Data safety section. Watch the Google Play PolicyBytes – Data safety form walkthrough. Check Google Play SDK Index to see if your SDK provider has shared a link to their data safety guidance. Review how any third-party code (such as third-party libraries or SDKs) in your app collects and shares user data. Action required: Submit an updated app for review Here’s what to do to help get your app on Google Play: Make sure to read the applicable policies or requirements listed below: Data safety section in Google Play User Data policy Make appropriate changes to your app (if possible), and be sure to address the issue described above. You may also want to check your app’s store listing for compliance, if applicable. Double check that your app is compliant with all other Developer Program Policies. If you made changes to your app bundle, store listing, or APK, please sign in to your Play Console and submit the update(s). Contact support If you’ve reviewed the policy and feel our decision may have been in error, please reach out to our policy support team. We’ll get back to you within 2 business days.

I installed SSL(https://www.gogetssl.com/) and redirect http to https by adding .htaccess but I still updates rejected

PHP Prophecy test void method should be called

I’m writing some Unit Tests using PHP Prophecy as Mocking Framework.

I’m trying to make a test to assure a void method is called, the code looks something like this:

private Prophet $prophet;

protected function setUp()
{
  $this->prophet = new Prophet();
}

protected function tearDown()
{
  $this-prophet->checkPredictions();
}


public function testFoo()
{
  $fooMock = $this->prophet->prophesize(Foo::class);
  $fooMock->execute()->shouldBeCalled();
  $fooMock->reveal();

  ...
}

Each time I’m trying to execute the test I’m getting the following error:

ProphecyExceptionCallUnexpectedCallException: Unexpected method call on DoubleAppFooP1

On my other test where I check that execute is not called everything works perfectly fine.

Cloudflare Images / How to approach avatars for users and other models?

By default, I want the user to be able to choose 1 of 30 ready-made avatars. If he wants – he can also upload his own.

  1. Should the default avatars be uploaded to cloudflare images or should they be on the frontend, which will also be hosted in cloudflare?

  2. Should I add an avatar column to each table in the database for models that can have an avatar? Or create an images table in which the id of all photos will be stored, including avatars with column collection = avatar?

  3. Do you have any tips and advice on how to approach the topic of avatars and photos?

  4. How do I ensure data integrity in my database and cloudflare images? I’m afraid that there will be a situation that some “abandoned photos” will remain in cloudflare images.

  5. I mainly use direct upload url, so photos don’t go to my api, but directly to cloduflare. However, when the user adds media but has not added a post/review. The photos will stay in cloudflares. I solved it this way that each id is saved in the temporary table “cloduflare_temporary_images”. If the photo is used – it is removed from this table. If 24 hours pass, it performs a delete request to cloudflare. Is this a good solution or can it be approached better?

By default, I want the user to be able to choose 1 of 30 ready-made avatars. If he wants – he can also upload his own.

Laravel Eloquent camel case in API, snake case in DB

Is there a pretty simple solution or package to make all my model properties camelCase while dealing with API (request, response) but using snake_case in my database? I don’t really want to use attribute setters/getters for every single property, I need something less hacky.

Laravel PHP overriding method with different parameters

Apologies if this has been asked many times before and if this is simply not doable in Laravel/PHP.

In my Laravel app I have a PostController which uses Laravel’s resourceful naming conventions. I also have a CommentController that mostly replicates the PostController in every way and so I have decided that the CommentController should extend PostController.

The only difference so far is that the store() methods need to accept different FormRequest objects as they have different validation rules. So I have overridden the store() method to expect CommentFormRequest instead of PostFormRequest (both of which extend FormRequest).

This is kicking up an error that the overriding method parameters need to match the base method.

Is this expected? and is there a sensible solution to what I’m trying to do?

Get a file extension from a image URL?

I get a random image like this:

https://picsum.photos/200/200?random=61081

How can I get the image extension? jpg/png etc.?

I’ve considered this: $extension = pathinfo($file, PATHINFO_EXTENSION); but it does not work.

EDIT: $extension = pathinfo($file, PATHINFO_EXTENSION); gives an empty string.

XML External Entity Attacks (XXE) : “An error occured!”

I am pentesting XML External Entity Attacks (XXE) in Bwapp, level :low
After capturing the packet in the burpsuit, I added the code in picture

code

on youtube videos it works fine but when i run it : An error occured!
I’m looking for many ways that haven’t been completed yet. Do you have problems like me? If you guys ever successfully fix it, can you help me, thank youuuu

Higher version of PHP collapsed my laravel web application which was coded in lower version of php

enter code herea web application was developed in laravel 7.0 and php 7.2.5 in the year 2020. three years later ,sytem was upgraded and hence LAMP was also updated PHP to 8.2.4. when i installed my application in web server and execute server artisan command

php artisan serve

  PHP Fatal error:  During inheritance of ArrayAccess: Uncaught 
 ErrorException: Return type of 
 IlluminateSupportCollection::offsetExists($key) should either 
be compatible with ArrayAccess::offsetExists(mixed $offset): bool, 

or the #[ReturnTypeWillChange] attribute should be used to
temporarily suppress the notice inenter code here
/var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Support/Collection.php:1294
Stack trace:
#0 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Support/Collection.php(11): IlluminateFoundationBootstrapHandleExceptions->handleError()
#1 /var/www/html/sakhawatapp/vendor/composer/ClassLoader.php(444): include(‘…’)
#2 /var/www/html/sakhawatapp/vendor/composer/ClassLoader.php(322): ComposerAutoloadincludeFile()
#3 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Support/helpers.php(109): ComposerAutoloadClassLoader->loadClass()
#4 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(89): collect()
#5 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(78): IlluminateFoundationPackageManifest->config()
#6 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php(26): IlluminateFoundationPackageManifest->aliases()
#7 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(228): IlluminateFoundationBootstrapRegisterFacades->bootstrap()
#8 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(311): IlluminateFoundationApplication->bootstrapWith()
#9 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(128): IlluminateFoundationConsoleKernel->bootstrap()
#10 /var/www/html/sakhawatapp/artisan(35): IlluminateFoundationConsoleKernel->handle()
#11 {main} in /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Support/Collection.php on line 11
PHP Fatal error: Uncaught ErrorException: Method ReflectionParameter::getClass() is deprecated in /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Container/Container.php:875
Stack trace:
#0 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Container/Container.php(875): IlluminateFoundationBootstrapHandleExceptions->handleError()
#1 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Container/Container.php(838): IlluminateContainerContainer->resolveDependencies()
#2 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Container/Container.php(685): IlluminateContainerContainer->build()
#3 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(794): IlluminateContainerContainer->resolve()
#4 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Container/Container.php(264): IlluminateFoundationApplication->resolve()
#5 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Container/Container.php(803): IlluminateContainerContainer->IlluminateContainer{closure}()
#6 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Container/Container.php(685): IlluminateContainerContainer->build()
#7 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(794): IlluminateContainerContainer->resolve()
#8 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Container/Container.php(633): IlluminateFoundationApplication->resolve()
#9 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(779): IlluminateContainerContainer->make()
#10 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(164): IlluminateFoundationApplication->make()
#11 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(108): IlluminateFoundationBootstrapHandleExceptions->getExceptionHandler()
#12 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(94): IlluminateFoundationBootstrapHandleExceptions->renderForConsole()
#13 /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(130): IlluminateFoundationBootstrapHandleExceptions->handleException()
#14 [internal function]: IlluminateFoundationBootstrapHandleExceptions->handleShutdown()
#15 {main}
thrown in /var/www/html/sakhawatapp/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 875

then i updated composer, and got errors

Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - laravel/ui[v2.0.0, ..., v2.4.1] require php ^7.2.5 -> your php version (8.2.4) does not satisfy that requirement.
    - illuminate/support[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.2.4) does not satisfy that requirement.
    - Only one of these can be installed: illuminate/support[v5.5.0, ..., 5.8.x-dev, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev, v9.0.0-beta.1, ..., 9.x-dev, v10.0.0, ..., 10.x-dev], laravel/framework[v10.0.0, ..., 10.x-dev]. laravel/framework replaces illuminate/support and thus cannot coexist with it.
    - laravel/ui[v2.5.0, ..., 2.x-dev] require illuminate/support ^7.0 -> satisfiable by illuminate/support[v7.0.0, ..., 7.x-dev].
    - Root composer.json requires laravel/ui ^2.0 -> satisfiable by laravel/ui[v2.0.0, ..., 2.x-dev].
    - Root composer.json requires laravel/framework ^10.0 -> satisfiable by laravel/framework[v10.0.0, ..., 10.x-dev].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Now i request all the expert community members to help me out. i have not upgraded live laravel application before.

for refrence please check out my composer.json file

{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
    "framework",
    "laravel"
],
"license": "MIT",
"require": {
    "php": "^7.2.5",
    "barryvdh/laravel-dompdf": "^0.8.6",
    "fideloper/proxy": "^4.2",
    "fruitcake/laravel-cors": "^1.0",
    "guzzlehttp/guzzle": "^6.3",
    "laravel/framework": "^7.0",
    "laravel/tinker": "^2.0",
    "yajra/laravel-datatables-oracle": "^9.9"
},
"require-dev": {
    "facade/ignition": "^2.0",
    "fzaninotto/faker": "^1.9.1",
    "laravel/ui": "^2.0",
    "mockery/mockery": "^1.3.1",
    "nunomaduro/collision": "^4.1",
    "phpunit/phpunit": "^8.5"
},
"config": {
    "optimize-autoloader": true,
    "preferred-install": "dist",
    "sort-packages": true
},
"extra": {
    "laravel": {
        "dont-discover": []
    }
},
"autoload": {
    "psr-4": {
        "App\": "app/"
    },
    "classmap": [
        "database/seeds",
        "database/factories"
    ]
},
"autoload-dev": {
    "psr-4": {
        "Tests\": "tests/"
    }
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
    "post-autoload-dump": [
        "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
        "@php artisan package:discover --ansi"
    ],
    "post-root-package-install": [
        "@php -r "file_exists('.env') || copy('.env.example', '.env');""
    ],
    "post-create-project-cmd": [
        "@php artisan key:generate --ansi"
    ]
}

}

Query returns shorter varbinary string than the actual string

One of the tables stores long VARBINARY(MAX) strings to represent images.

I am trying to select images and convert them to back to images.

I noticed that the result shows a much shorter string:

$data = DB::select("
SELECT photo_string
FROM users_photos
WHERE user_id = 123
");

echo(strlen($data[0]->photo_string)); // shows 26633

But when I copy the string from the table and do strlen() on itm it’s 53268

The string looks like 0xFFD8FFE0......

Why?

PLEASE HELP I NEED TO UPDATE PHPMYADMIN I DONT KNOW TO EDIT IT I NEED TO UPDATE SOME INFO [closed]

I am having difficulty updating some details in my MySQL database. I do not know how to edit the database, and my site goes offline after I attempt to update it.

I have tried entering the new code into the MySQL database after entering the SQL code. However, my site still goes offline after I click “GO.” I am not sure where I am going wrong.

Would you be able to help me troubleshoot this issue? I would appreciate any advice you can offer.

i need to update this from version 4.5.1 to 5.0.0
https://solodroid.gitbook.io/android-news-app/migrate-from-older-version/v4.5.1-to-v5.0.0

Thank you for your time.

Error on Filtering data table on different entry

When I filter the data for a specific row, let’s say row 14, and my current view only shows 10 entries, it doesn’t display row 14. However, if I increase the number of entries per view to 25, then row 14 becomes visible. In that case, it seems like my current view or display settings are limiting the number of rows shown at a time.

Here are my view

function applyFilter() {
        var filterCategory = $('#filter_category').val();
        var filterContentType = $('#filter_content_type').val();

        $('#content tbody tr').hide();

        if (filterCategory != '' || filterContentType != '') {
            $('#content tbody tr').each(function () {
                var category = $(this).data('category');
                var contentType = $(this).data('content-type');

                if (
                    (filterCategory == '' || category == filterCategory) &&
                    (filterContentType == '' || contentType == filterContentType)
                ) {
                    $(this).show();
                }
            });
        } else {
            $('#content tbody tr').show();
        }

        $.ajax({
            url: 'e_learning/admin/content',
            type: 'POST',
            data: {
                category: filterCategory,
                content_type: filterContentType
            },
            success: function (response) {

                $('#content-list').html(response);
            },
            error: function (xhr, status, error) {
                console.error(error);
            }
        });
    }
 <div class="card-body bg-dark-transparent" id="form_collapse_list_0" style="">
        <div class="table-responsive bg-white p-2">
            <div id="table_forms_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4 no-footer">
                <div class="tab-pane fade active show" id="nav-home" role="tabpanel" aria-labelledby="nav-home-tab">
                    <div class="form-row">
                        <div class="form-group col-md-6">
                            <label for="filter_category">Category:</label>
                            <div class="d-flex align-items-center">
                                <select class="form-control" id="filter_category">
                                    <option value="">All Categories</option>
                                    <?php foreach ($rsFilterCategory as $key => $row) {
                                        $selected = (!empty($filter_category) && $filter_category == $row['title']) ? 'selected' : '';
                                        echo '<option value="' . $row["title"] . '" data-category="' . $row["title"] . '" ' . $selected . '>' . $row["title"] . '</option>';
                                    } ?>

                                </select>
                            </div>
                        </div>
                        <div class="form-group col-md-6">
                            <label for="filter_content_type">Content Type:</label>
                            <div class="d-flex align-items-center">
                                <select class="form-control" id="filter_content_type">
                                    <option value="">All Types</option>
                                    <option value="image">Image</option>
                                    <option value="video">Video</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="float-right">
                        <button class="btn btn-success rounded" onclick="applyFilter()">Apply Filter</button>
                        <button class="btn btn-warning rounded" onclick="clearFilter()">Clear Filter</button>
                    </div>
                </div>
            </div>
        </div>
    </div>

Woocommece – List product categories that also match product taxonomy

I have a list of products that site under product categories that work well. I also have CPT setup of ‘shop_location’ so here we can list different shop locations.

I want to show the product categories (that have products) for a specfic taxonomy of shop_location.

So e.g. I want to show all product categories (with products), for the shop_location which is equals to London.

I have tried the following but this is not firing correctly, could someone please help me. Thank you!

<?php
$orderby = 'name';
$order = 'asc';
$hide_empty = false ;
$cat_args = array(
    'orderby'    => $orderby,
    'order'      => $order,
    'hide_empty' => $hide_empty,
    'tax_query' => array(
        array(
            'taxonomy'  => 'shop_location',
            'terms'     => array( $category->slug ),
            'field'     => 'london',
        )
    )   
);

$product_categories = get_terms( 'product_cat', $cat_args );

if( !empty($product_categories) ){
    echo '

<ul>';
    foreach ($product_categories as $key => $category) {
        echo '

<li>';
        echo '<a href="'.get_term_link($category).'" >';
        echo $category->name;
        echo '</a>';
        echo '</li>';
    }
    echo '</ul>


';
}
   ?> 

PHP Symfony – Autowiring Interface as constructor argument but using specific class from interface on test .env

Imagine we have the following Interface:

interface FooInterface {
//...
}

We have two classes that implements this interface:

class Foo implements FooInterface {
  //...
}

class Bar implements FooInterface {
  //...
}

In Symfony I want to inject the Interface and whenever I use FooInterface as DI in a constructor of a class I want the specific class “Foo”. E.g.

class SomeClass {

  public function __construct(FooInterface $foo) { ... }

}

So far so good, now I want to inject the Class “Bar” only when Im on the test environement. (.env APP_ENV=test)

Is there a global config that I can use to specify which class will be injected based on the environment ?