0

I'm having a problem with a TinyMCE plugin using long GET parameters. On my development server, the plugin works just fine. However, on the production server, the parameter is ignored.

The plugin is SMImage, it uses parameters like this one:

40a6ff4a9832c3e3f8e2fed4d50dc8c6cc42409476b487da936f60cf315f57ccc39c7629d4146097ade572cdf409083257eb2d6edbff7b46556efafd07d4802521d17e14d1021baeac712f8ee83be1f768f14f849e58edb37c8fcd9a8e61e5235a1bb885b0dd1c5b85a2642f22fba99d304a6f988795e1c2b088b8f80e7acc69bc0cea7f763320a6611bd24bc924e0e1bda887990f560cbbd9e1608545fd69859a1808286a263d4754b8b1f6a713c9bdaaa015649b92db2701b005bd91e6827ff4bde6b48bcb0e5ca509f568684c51a803dbc7f896cdfdbcd0cfafc202e20d68f45cdfe86b033f36ff05a0f52cc6381231682d20d3038fc4fe7aba0916c614e89ff2b64c6b6bae0b548f

Which is kinda long, but shouldn't be much of a problem (except on IE of course).

Under the production server, $_GET['get'] is not even defined, since it's ignored by PHP.

Is there a server setting that can be changed perhaps? Under PHP, what defines the maximum length?

I could use POST instead, but I'm not too sure how I could change this part of the plugin:

    var get = 'id=1' + '&dir_root=' + ed.getParam('plugin_smimage_directory', '') + '&server=' + ed.getParam('plugin_smimage_server', '') + '&thumbnail_size=' + ed.getParam('plugin_smimage_thumbnail_size', '') + '&show_thumbnail=' + ed.getParam('plugin_smimage_show_thumbnail', '') + '&jpg_quality=' + ed.getParam('plugin_smimage_jpg_quality', '') + '&orderby=' + ed.getParam('plugin_smimage_orderby', '') + '&show_upload=' + ed.getParam('plugin_smimage_show_upload', '') + '&show_image_menu=' + ed.getParam('plugin_smimage_show_image_menu', '') + '&show_folder_menu=' + ed.getParam('plugin_smimage_show_folder_menu', '') + '&show_newfolder=' + ed.getParam('plugin_smimage_show_newfolder', '') + '&thumbnails_perpage=' + ed.getParam('plugin_smimage_thumbnails_perpage', '') + '&upload_filesize=' + ed.getParam('plugin_smimage_upload_filesize', '') + '&check_session_variable=' + ed.getParam('plugin_smimage_check_session_variable', '') + '&document_root=' + ed.getParam('plugin_smimage_document_root', '');
    ed.windowManager.open({
      file: url + '/index.php?get=' + SMImage_BinToHex(SMImage_RC4(get)),
      width: ed.getParam('plugin_smimage_width', '800'),
      height: ed.getParam('plugin_smimage_height', '500'),
      inline: 1
    },
    {
      plugin_url: url
    })
jValdron
  • 3,408
  • 1
  • 28
  • 44

1 Answers1

0

Not sure if this is good idea, but you could try using cookie as workaround for passing that kind of parameters. In JS, before calling this window open, do smth like

document.cookie = 'SMImage_param=' + SMImage_BinToHex(SMImage_RC4(get))

and then call index.php without parameters. On server-side use

$_COOKIE['SMImage_param']

for getting this parameter value.

Of course, it will work only if PHP you are calling is on the same domain (but I'm almost sure that for your TinyMCE plugin it's there).

RReverser
  • 1,940
  • 14
  • 15
  • And, of course, if you have access to server configuration - you should configure it as is mentioned in http://stackoverflow.com/questions/7724270/max-size-of-url-parameters-in-get instead. – RReverser Mar 12 '12 at 21:07
  • Yeah Suhosin was installed, just did a php.ini ;) Thanks for taking the time to answer! :) – jValdron Mar 12 '12 at 21:09
  • @ThiefMaster Agree)) I just thought that author has no access to server configuration, so wrote the only hack that came up into mind :) – RReverser Mar 12 '12 at 21:12