[geeklog-cvs] geeklog: Fixed call to undefined function WS_makeId() when using...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sat Apr 24 13:30:35 EDT 2010


changeset 7893:f5b6602b0952
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/f5b6602b0952
user: Dirk Haun <dirk at haun-online.de>
date: Sat Apr 24 19:28:06 2010 +0200
description:
Fixed call to undefined function WS_makeId() when using very long story ids (bug #0001140)

diffstat:

 public_html/docs/history |   2 ++
 system/lib-story.php     |  14 +++++++++++++-
 2 files changed, 15 insertions(+), 1 deletions(-)

diffs (43 lines):

diff -r d8d05e77d0fe -r f5b6602b0952 public_html/docs/history
--- a/public_html/docs/history	Sat Apr 24 17:10:25 2010 +0200
+++ b/public_html/docs/history	Sat Apr 24 19:28:06 2010 +0200
@@ -7,6 +7,8 @@
 2009 Google Summer of Code.
 
 Changes since 1.7.0b1:
+- Fixed call to undefined function WS_makeId() when using very long story ids
+  (bug #0001140) [Dirk]
 - Fixed cloning of a story (bug #0001127, patch provided by Eric Brisco)
 - The installation script now recommends setting permissions to 666 for files
   and 777 for directories that need to be writable (bug #0001126, patch
diff -r d8d05e77d0fe -r f5b6602b0952 system/lib-story.php
--- a/system/lib-story.php	Sat Apr 24 17:10:25 2010 +0200
+++ b/system/lib-story.php	Sat Apr 24 19:28:06 2010 +0200
@@ -1151,6 +1151,10 @@
     }
 
     require_once $_CONF['path_system'] . 'lib-comment.php';
+    if (version_compare(PHP_VERSION, '5.0.0', '>=') &&
+            (! $_CONF['disable_webservices'])) {
+        require_once $_CONF['path_system'] . 'lib-webservices.php';
+    }
 
     $gl_edit = false;
     if (isset($args['gl_edit'])) {
@@ -1308,7 +1312,15 @@
     $args['sid'] = COM_sanitizeID($args['sid']);
     if (!$gl_edit) {
         if (strlen($args['sid']) > STORY_MAX_ID_LENGTH) {
-            $args['sid'] = WS_makeId($args['slug'], STORY_MAX_ID_LENGTH);
+            $slug = '';
+            if (isset($args['slug'])) {
+                $slug = $args['slug'];
+            }
+            if (function_exists('WS_makeId')) {
+                $args['sid'] = WS_makeId($slug, STORY_MAX_ID_LENGTH);
+            } else {
+                $args['sid'] = COM_makeSid();
+            }
         }
     }
     $story = new Story();



More information about the geeklog-cvs mailing list