Permalink batch

23 posts by 7 authors in: Forums > CMS Builder: Plugins & Add-ons
Last Post: July 15, 2015   (RSS)

By Toledoh - June 12, 2015

I'll be in that test Dave.

Cheers,

Tim (toledoh.com.au)

By Dave - June 18, 2015

Hi Guys, Just wanted to let you know I've got this in the queue and working on an beta release.  Stay tuned.

Dave Edis - Senior Developer
interactivetools.com

By Maurice - July 6, 2015

Great any idea when? for a release date?

-------------------------------------------

Dropmonkey.nl

By admin - July 8, 2015

Sorry for the delay!  Almost done, should be able to post it tomorrow, and then a CMSB alpha release after that.  Stay tuned and thanks for the reminder.

By Dave - July 8, 2015 - edited: July 8, 2015

Logged in with the wrong account.  That was posted by me...  :-)

Dave Edis - Senior Developer
interactivetools.com

By Djulia - July 10, 2015

Hi Dave,

Debug Output gives this error:

E_WARNING: preg_match() expects parameter 2 to be string, array given

Array
(
    [logType] => runtime
    [errno] => 2
    [errstr] => preg_match() expects parameter 2 to be string, array given
    [errfile] => permalinks_dispatcher.php
    [errline] => 63
    [errcontext] => *** in symbol table field above ***
)

Thanks!

Djulia

By Djulia - July 10, 2015

Hi Dave,

I obtain also this error on errors 404.

buy.php page does not exist on the server.

[SCRIPT_URL] => /buy.php
[SCRIPT_URI] => http://www.mydomain.com/buy.php

Array
(
    [logType] => runtime
    [errno] => 2
    [errstr] => preg_match() expects parameter 2 to be string, array given
    [errfile] =>permalinks_dispatcher.php
    [errline] => 42
    [errcontext] => *** in symbol table field above ***
)

Thanks!

Djulia

By Dave - July 10, 2015

Thanks Djulia, 

Looks like there is an unexpected array in $_SERVER.  Can you send me the "symbol table" values for $_SERVER from the error log record? 

Feel free to email direct: dave@interactivetools.com

Thanks!

Dave Edis - Senior Developer
interactivetools.com

By Dave - July 10, 2015

Thanks for your email, Djulia,

It's because you have a PHP.ini setting register_argc_argv enabled that adds an array with argv (command line arguments) to $_SERVER.  I didn't know about that possibility so it's a good find!

In permalinks_dispatcher.php:

Search for getCurrentUserFromCMS and replace this: 

if (preg_match("/non-existant-url/", $value)) {
  $CMS_USER = getCurrentUserFromCMS();

With this:

if (!is_array($value) && preg_match("/non-existant-url/", $value)) {
  $CMS_USER = getCurrentUserFromCMS();

Search for ksort and replace this: 

ksort($_SERVER);
foreach ($_SERVER as $key => $value) {
  if (preg_match("/ORIG|PATH_INFO|QUERY|REDIRECT|SCRIPT|URI|URL/i", $key) || preg_match("/non-existant-url|permalinks/", $value)) {
  $debugInfo[$key] = $value;
  }
}

With this:

ksort($_SERVER);
foreach ($_SERVER as $key => $value) {
  $keyMatches = preg_match("/ORIG|PATH_INFO|QUERY|REDIRECT|SCRIPT|URI|URL/i", $key);
  $valueMatches = !is_array($value) && preg_match("/non-existant-url|permalinks/", $value);
  if ($keyMatches || $valueMatches) { $debugInfo[$key] = $value; }
}

Can you let me know if that fixes it for you?

Thanks!

Dave Edis - Senior Developer
interactivetools.com