GithubHelp home page GithubHelp logo

gyro-php's People

Contributors

gerdriesselmann avatar hwde avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

gyro-php's Issues

Fallback for DEFAULT_SCHEME should be depend on APP_ENABLE_HTTPS

Recently I had a very rare redirect error with a new setup:

  • APP_ENABLE_HTTPS was set to true,
  • APP_DEFAULT_SCHEME was undefined.

When opening the domain in browser, i.e. https://example.com the page was redirected to http://example.com and the again to https://example.com ... and so on. I could fix this with setting APP_DEFAULT_SCHEME to https. This was the first time I saw this kind of error, webserver is nginx/php-fpm (7.3)

In gyro/core/constants.inc.php line #49 is:

Config::set_value_from_constant(Config::DEFAULT_SCHEME, 'APP_DEFAULT_SCHEME', 'http');

Maybe the fallback of "http" should be set to https if ENABLE_HTTPS/APP_ENABLE_HTTPS is true?

Url drops duplicated parameter

Given a URL with the same parameter assigned twice like

www.example.com?q=a&q=b

The URL class will only keep the second (q=b), dropping the first. This is similar to PHP'S $_GET array, but not helpfull when reading and building URLs.

Change this so get_query_parameter() resembles PHP behavior, but build() outputs the original URL.

Extend HttpRequest to be more flexible to use

HttpRequest currently can not be extended easily, e.g. by custom HTTP Headers or by other type of POST body data. Rewrite to use a config that can does configuration of CURL request and can be overloaded by user.

Feature Request: POST json data with GyroHttpRequest

Would be nice to wrap something like this with gyro-php:

        $data = ConverterFactory::encode($data, CONVERTER_JSON);

        try {
            $ch = curl_init($url);
            curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");

            curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
            curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
            curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1);

            if (!ini_get('safe_mode')) {
                curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
            }

            curl_setopt($ch, CURLOPT_HTTPHEADER, array(
                'Content-Type: application/json',
                'Content-Length: ' . strlen($data))
            );
            $result = curl_exec($ch);

Q: dbfield.float read_from_array use delocalize_number

Hi Gerd,

I've an issue with dbfield.float ... but only on external server, not locally in docker development. Maybe you've an idea:

  • app/constants.php has a define('APP_LANG', 'de');
  • my MySQL table contains a field with decimal(12,2)

Whenever I type something in remote server forms for that field, i.e. "1", after form has been saved the form updates to the DB value "1.00" (which is what I expect). But next time I save the form, "1.00" will be delocalized (from dbfield.float read_from_array() to 100, so the the number updates to "100", which is wrong.

I would expect that GyroString::localize_number has to be called somewhere, so that the form values contains "1,00" instead of "1.00", so delocalize_number makes sense ... but core never called it.

I assume date.timezone = Europe/Berlin (which is used on external server) cause the issue?

contributions usermanagement.notifications: notify_all_users create notifications with empty creationdate

Initially the database column creationdate is setup with

creationdate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,

in install.sql, but revised to

MODIFY COLUMN creationdate DATETIME NOT NULL,

in 0003-Update. I assume there was a reason to do so.

Without a valid creationdate the internal clicktracking / url-rewriting fails, becasue the sha-checksum is based on creationdate too - and a 0 in creationdate seems to be replaced "somewhere" with a current timestamp before the clicktracking is applied - but not on single get's later when the clicktracking token is compared.

So a possible fix is to change mass-insert in notifyall.cmd.php to set a propper "creationdate" on insert.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.